I was playing with the PowerAutomate approvals tonight, and, since I have not used them at all before, I am wondering if CDS is an “add on” for the approvals or if CDS is a pre-requisite?
See, when looking at the link above, it seems I don’t need CDS to work with the approvals:
However, all Approvals-related entities are already available in CDS:
It seems there is not a lot of documentation covering approval entities in CDS, but there is this support article which is interesting in a few ways – first of all, it confirms that approvals data is, in fact, stored in CDS. However, it also makes a point that “the schema is complex, not publicly documented and is subject to change”:
What I was interested in is: can we use CDS approval entities to create a Flow that will start once there is an approval response and what kind of information can we extract from that response in the Flow?
Turned out we can certainly create such a Flow, and, also, we can extract all the information we need.
Well, this post would not be worth much if it were all straightforward, right?
So, of course, there is a gotcha.
In the CDS environment, you will have Microsoft Flow account:
This account, by default, will have only one role:
As soon as you create a PowerAutomate Flow that is triggered on create of new Approval Response in CDS, you will suddenly lose the ability to approve all those approval requests. Even when using a full admin account, you will be getting an error:
This is a weird error, since there is just no way my account would not have CDS permissions. The error message is way more detailed when trying to approve a request through the web portal:
With that ID, I can quickly prove that it’s a permissions error for the “Microsoft Flow” user account:
So, in order to make this work, you will first need to create a security role that gives read access to the “Systme Job” entity and assign it to the Microsoft Flow account:
Why did I call it “Microsoft Flow Approvals”? Well, it’s “Microsoft Flow” account… You can call it “Power Automate Approvals”, though
With that, everything starts working – I can continue approving all those approval requests, and, yet, the Flow I had set up to respond to new approval responses is working, too:
This kind of Flow allows for some interesting options. For example:
what if you had multiple approvers for a certain type of approval requests, and what if you wanted to keep sending reminders to only those of the approvers who are not very responsive? It seems PowerAutomate Approvals themselves won’t get you enough flexibility to do that – you will be able to send a reminder, but the best solution I’ve seen so far (unless I misunderstood it), even though it will allow you to send reminders to all approvers in a parallel Flow branch, still won’t be able to differentiate those approvers who actually need to be reminded from those who have already provided their approvals:
https://teylyn.com/2020/01/07/timing-microsoft-powerautomate-approval-reminders/
Once you start working with the CDS entities, each approval response will have its “Owner” set to the approver. So, if there are two required approvers for an approval, you will only need to send a reminder if there is no approval response owned by that approver for the approval request.
PS. Actually, now I’m thinking creating such a reminder might be a good exercise for the upcoming PowerStorm session on July 16: https://www.itaintboring.com/powerstorm/ At least it’s one option among a few I’ve been thinking of so far, though any suggestions you might have are welcome. And don’t forget to register while there are still a few spaces, btw
Great article! I encountered this error and was at a loss on how to correct it. Where do I access the security roles for CDS? I can’t seem to find this area. Thanks, have a blessed day! 🙂
Great article!!What about to get information for a particular flow. Such as who is missing approval when you have multiple folks for a business process.
Great article.
I’m using a power automate flow that’s triggered by CDS (Dataverse) when an approval is completed. (As advised in the long running workflow post)
As long as the same user is requesting and responding to the approval all is working fine.
However, when a different user responds, the related response is invisible for that (requesting)user in CDS…
I suppose it is security related.
Is there a way so that the requesting user can also query the related responses in CDS? Or is there another way I can get to the approvers response?