cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate I
Advocate I

Button triggered flow - Get Record action failing as "Unauthorised"

Hi All

 

I am running a flow from a button in a canvas app that is embedded in a model driven app form - it needs to use the record id of the record currently open in the form.

 

The flow runs correctly when triggered manually but when I changed the trigger to Power Apps and attached the flow to the button the Get Record action fails with a note saying "Unauthorised" with the "Output" text shown below, followed by a screenshot of the flow test results and a screenshot of the actual flow.

 

Does anyone have any ideas as to how I can solve this?

 

Thanks!

 

Simon

 

Output Text

{"statusCode":401,"headers":{"x-ms-service-request-id":"306cb916-dd4d-4ea6-8ab6-f5737314939f,e0b43654-d202-4e7d-8b81-c8d475263a46","Set-Cookie":"ARRAffinity=419ae23f118f21674ab1e97561491a01f2c13ead6792ebae5fbc1431abcd355f; domain=XXXXXXXX.crm11.dynamics.com; path=/; secure; HttpOnly,ReqClientId=b678aa94-0e9a-4402-89c6-f3adae4ba501; expires=Sun, 03-Aug-2070 11:29:01 GMT; path=/; secure; HttpOnly; samesite=none,ARRAffinity=419ae23f118f21674ab1e97561491a01f2c13ead6792ebae5fbc1431abcd355f; domain=XXXXXXX.crm11.dynamics.com; path=/; secure; HttpOnly","WWW-Authenticate":"Bearer authorization_uri=https://login.microsoftonline.com/2c78a6be-d47e-440e-9089-1d77de02c7c2/oauth2/authorize, resource_id=https://XXXXXXXX.crm11.dynamics.com/","Strict-Transport-Security":"max-age=31536000; includeSubDomains","REQ_ID":"e0b43654-d202-4e7d-8b81-c8d475263a46","AuthActivityId":"982506a2-d8b8-4e96-92c3-2fd20c20d4b3","NativeWebSession-Version":"2","X-Source":"802161491481472041374347217250612432378542127206017227119854747119910416216320112,159922514024515612312625574143218233194815721932188416170224232321855625314421267129","Public":"OPTIONS,GET,HEAD,POST","Timing-Allow-Origin":"*","Date":"Mon, 03 Aug 2020 11:29:01 GMT","Content-Length":"0","Allow":"OPTIONS,GET,HEAD,POST"}}

 

 

Capture.JPG

Capture1.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Button triggered flow - Get Record action failing as "Unauthorised"

 

Hi @sdowse ,

 

Thank you for your reply and the detailed process of troubleshooting! That's exactly the step I will recommend to you to troubleshoot the problem, but it doesn't seem to work.

I am afraid that there is no way to reproduce similar issues on my side, so I cannot provide you with a suitable workaround or solution for the time being.

Please consider contacting Microsoft Support to help you resolve these issues: Power Platform admin center

Hope you can find a suitable solution here.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
Highlighted
Community Support
Community Support

Re: Button triggered flow - Get Record action failing as "Unauthorised"

 

Hi @sdowse ,

 

Please refer to the similar thread and see if it helps:

Solved: PowerApps trigger 401 error for getting CDS record - Power Platform Community

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Advocate I
Advocate I

Re: Button triggered flow - Get Record action failing as "Unauthorised"

Thanks @v-bacao-msft - I didn't find that thread when I was searching!

 

I've not changed my password but I tried deleting the connection and creating a new one, but that didn't work. I also tried running it in an in-private window, but again it still failed.

 

The button in the embedded canvas app starts the flow to save the user having to update the record manually (and then updates the statuses of other linked records and then creates several other records in other entities) so it's not really an option to use the "when a record is updated" option.

 

The trigger is getting the correct record id from the record open in the model driven app form and passing it correctly to the Get Record action - unfortunately I'm not clever enough to understand the error information in the output!

 

I'll try creating a new flow and see if that works......

 

Thanks for your time!

 

Simon

Highlighted
Advocate I
Advocate I

Re: Button triggered flow - Get Record action failing as "Unauthorised"

I've done some more testing.

 

I'm using the CDS current environment actions, but if I change to just the normal CDS actions the flow works. Having changed the Get Record action to a normal CDS action the following action (which was still a CDS current environment action) then failed with the same issues - so we are looking at an issue with all the CDS current environment actions, rather than just the Get Record action.

 

I have been using the CDS current environment actions as I thought it would make it easier when I export my custom solution from my Community Plan environment to a "proper" production environment (as I am guessing it would mean I won't have to update all the actions to point to the new environment) - is this correct or do "normal" CDS actions get updated to point to the new environment as part of the export?

 

Thanks!

 

Simon

Highlighted
Regular Visitor

Re: Button triggered flow - Get Record action failing as "Unauthorised"

Done some testing myself.

 

My solution worked 4 weeks ago, the most recent change I made was adding a security role to my solution.

Then exported my solution from my own environment to the Company Test environment. Then it stopped working on my own environment as well as the company-wide environment. 
Do you have security roles in your solution? Maybe it's bugging because of those. 

 

Also tried recreating my flow, as I've had some problems with a flow's trigger in the past. Basic flow with the same functionality as my main application, but not as complicated, still the same issue. 

Highlighted
Advocate I
Advocate I

Re: Button triggered flow - Get Record action failing as "Unauthorised"

No - I've not got any security roles set up.

 

My flow runs from a button in a canvas app that's embedded in a model driven app form - the flow needs to know what record is open in the model driven form so it needs to be passed that information from power apps - so I'm a bit stuck until they fix it, but I've got lots of other bits of the app to work on in the meantime!!

Highlighted
Community Support
Community Support

Re: Button triggered flow - Get Record action failing as "Unauthorised"

 

Hi @sdowse ,

 

Thank you for your reply and the detailed process of troubleshooting! That's exactly the step I will recommend to you to troubleshoot the problem, but it doesn't seem to work.

I am afraid that there is no way to reproduce similar issues on my side, so I cannot provide you with a suitable workaround or solution for the time being.

Please consider contacting Microsoft Support to help you resolve these issues: Power Platform admin center

Hope you can find a suitable solution here.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Advocate I
Advocate I

Re: Button triggered flow - Get Record action failing as "Unauthorised"

Hi @v-bacao-msft 

 

Thanks for your message - MS have said there is a known issue with a power apps triggered flow that uses the CDS (current environment) actions and they are working on it. Hopefully they'll get it mended soon!

 

Simon

 

 

Helpful resources

Announcements
Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Top Solution Authors
Top Kudoed Authors
Users online (5,138)