cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MAYLIWK
Frequent Visitor

Power Automate and Common Data Services Permissions

I am currently building an approval flow that will need the requirement to cancel a current approval. I was able to find a few discussions on how to complete this task using the common data services feature within Power Automate but I am running into a security issue. The error states that I need the 'prvWritemsdyn_flow_approval' privilege. 

 

My question is on how/where to set this permission. Can anyone spell this out for me or point me in the right direction?

 

Thanks for the help 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Power Automate and Common Data Services Permissions

Hello @MAYLIWK 

 

Sorry I came down with a cold and a walkthrough slipped my mind.

 

So get your admin to try this:

 

1) head to Power Platform admin center

https://admin.powerplatform.microsoft.com/support

 

2) Click Data Policies

 

3) Click Environments

 

4) Select the Environment that your Flow is in

 

5) Here you see 3 tabs <Details, Security, and Resources>

Click Security tab

 

6) Now click the button Assign security roles

 

7) A new screen will pop up, with a list of all users in the Environment. Search for the User that is using the CDS connection

This is most likely your account, but best practice would be to have a service account.

 

😎 Click on the user > which will bring up another pop up. In the top header click Manage Roles

 

9) Here is all the default roles (and custom roles if any were made) The roles you will most likely need is:

Approvals User. If you still get the error. Than try the Approvals Administrator.

Depending on your.

 

I have attached some screenshots of the above steps.

 

If you have any issues or problems after applying the above fix.

Please post the error message from flow

Thanks

Here is the Pictures:

pic1.png

 

pic2.png

 

pic3.png

 

pic4.png

 

pic5.png

 

pic6.png

 

Hope this helped.

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others

 

 





Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up ?


Proud to be a Flownaut!





View solution in original post

12 REPLIES 12
Super User
Super User

Re: Power Automate and Common Data Services Permissions

Hello,

First off you will need admin rights in that environment, where CDS entities are.

My personal opinion would be to have your Org setup a Service Principal. And give that account the appropriate permissions.

If you are admin in that Environment, let me know I can post here what to do.

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others




Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up ?


Proud to be a Flownaut!





MAYLIWK
Frequent Visitor

Re: Power Automate and Common Data Services Permissions

@Jcook 

Thanks for the response. Could you post the instructions? I will have to take them to the team. Also, if you have any links about how the CDS work, I would appreciate that as well. I haven't been able to find anything useful.

Super User
Super User

Re: Power Automate and Common Data Services Permissions

Yes for sure. I am not near a computer right now. So I cannot walk through. I can post something on this later tonight,

Here is some information right now:

http://www.sharepointalex.uk/office-365/powerapps-creating-and-assigning-cds-security-roles/

https://community.dynamics.com/crm/b/dynamicscrmtipoftheday/posts/tip-1297-base-your-base-role-on-th...

https://docs.microsoft.com/en-us/power-platform/admin/wp-security-cds

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others




Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up ?


Proud to be a Flownaut!





MAYLIWK
Frequent Visitor

Re: Power Automate and Common Data Services Permissions

@Jcook  any chance that you could post that walkthrough when you get a moment?

 

Thanks

Super User
Super User

Re: Power Automate and Common Data Services Permissions

Hello @MAYLIWK 

 

Sorry I came down with a cold and a walkthrough slipped my mind.

 

So get your admin to try this:

 

1) head to Power Platform admin center

https://admin.powerplatform.microsoft.com/support

 

2) Click Data Policies

 

3) Click Environments

 

4) Select the Environment that your Flow is in

 

5) Here you see 3 tabs <Details, Security, and Resources>

Click Security tab

 

6) Now click the button Assign security roles

 

7) A new screen will pop up, with a list of all users in the Environment. Search for the User that is using the CDS connection

This is most likely your account, but best practice would be to have a service account.

 

😎 Click on the user > which will bring up another pop up. In the top header click Manage Roles

 

9) Here is all the default roles (and custom roles if any were made) The roles you will most likely need is:

Approvals User. If you still get the error. Than try the Approvals Administrator.

Depending on your.

 

I have attached some screenshots of the above steps.

 

If you have any issues or problems after applying the above fix.

Please post the error message from flow

Thanks

Here is the Pictures:

pic1.png

 

pic2.png

 

pic3.png

 

pic4.png

 

pic5.png

 

pic6.png

 

Hope this helped.

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others

 

 





Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up ?


Proud to be a Flownaut!





View solution in original post

MAYLIWK
Frequent Visitor

Re: Power Automate and Common Data Services Permissions

@Jcook  Awesome!! Thanks for the help.

MAYLIWK
Frequent Visitor

Re: Power Automate and Common Data Services Permissions

@Jcook 

 

We setup a service account with these permissions but I am still running into an error. Please see below.

 

\"error\":
{\"code\":\"0x80040220\",\"message\":\"Principal user (Id=aaf78868-6272-e911-a81d-000d3a37ff78, type=8, roleCount=4, privilegeCount=688, accessMode=0, is missing prvWritemsdyn_flow_approval privilege (Id=289a0b9e-b7c7-4265-992a-0b7b1e921c30) on OTC=10008. context.Caller=aaf78868-6272-e911-a81d-000d3a37ff78\",\"innererror\":
{\
"message\":\"Principal user (Id=aaf78868-6272-e911-a81d-000d3a37ff78, type=8, roleCount=4, privilegeCount=688, accessMode=0, is missing prvWritemsdyn_flow_approval privilege (Id=289a0b9e-b7c7-4265-992a-0b7b1e921c30) on OTC=10008. context.Caller=aaf78868-6272-e911-a81d-000d3a37ff78\",\
"type\":\"System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]\",\

 

Thanks for the help. 

Super User
Super User

Re: Power Automate and Common Data Services Permissions

Hello @MAYLIWK 

 

Can you try and look in the Users Entity and find out which user the error is mentioning

(the guid /ID) aaf78868-6272-e911-a81d-000d3a37ff78

 

If this is your service principal account, add the sysadmin role and see if this fixes the issue

 

If the user the error is mentioning, than that user will also need the roles i mentioned before

 

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others

 

 

 





Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up ?


Proud to be a Flownaut!





MAYLIWK
Frequent Visitor

Re: Power Automate and Common Data Services Permissions

@Jcook 

 

Thanks, turns out it was still using my account while testing. 

 

One last question. I was able to update the approval record and it disappeared from the action items list on power automate website. However, it doesn't allow the workflow that's waiting for an approval response to continue after I update the approval record.

 

I manually cancelled an approval and looked at the approval record after I cancelled to compare the fields to what I am filling in. Looks like I have everything but one field. msdyn_flow_approval_result is coming back with a null for the record I canceled via power automate but it is coming back with "Canceled" for the approval I manually cancelled.

 

Manually cancelled meaning I went to my sent approvals with the Power Automate web site and hit the cancel button. 

 

I cant see the field within power automate that this correlates to. Do you know if there is one or will I have to create my own "wait for an approval" action with a loop?

 

Thanks

Super User
Super User

Re: Power Automate and Common Data Services Permissions

@MAYLIWK 

Could you share a picture of what the flow looks like?

 

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others

 





Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up ?


Proud to be a Flownaut!





MAYLIWK
Frequent Visitor

Re: Power Automate and Common Data Services Permissions

@Jcook 

 

Not sure which one you wanted. Here is the approval flow:

 

image.png

and here is the cancel flow (its just a test flow for now being triggered by an http request that I fill in the IDS manually

 

image.png

Super User
Super User

Re: Power Automate and Common Data Services Permissions

@MAYLIWK 

When you said you updated the Approval.

Is that from Flow or from the email / actions page?

 

Im wondering if you changed your action to Start and Wait for an Approval instead?

 

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others

 





Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up ?


Proud to be a Flownaut!





Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (6,684)