cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Power Apps triggered Flow - 401 unauthorized using CDS actions (Get record, get file content etc) but with other types of trigger they work fine

Hi,

 

I'm having some trouble using the Common Data Service actions.

 

I need a Flow that is triggered via a Power Apps button, within the Flow I'm then using 'Get record' to grab a specific record inside a CDS entity, then also I am retrieving the contents of a file field, combining the returned info to send in an email.

 

This was all working fine on Tuesday but this morning I'm now seeing 401 unauthorized on all CDS actions.

 

I did some digging and if I created a manually triggered Flow (e.g. via Flow button) then the CDS actions are working fine and I get the data back, same user account etc.

 

I definitely have access to the CDS still so it seems something funny is going on when the trigger is Power Apps - even when I test this Power App triggered Flow manually via the Flow tester I get the same error. Any ideas? A bit confused and wondering if there's just a bug right now or something I'm missing, since these actions work with different triggers.

 

Many thanks!

10 REPLIES 10
Pstork1
Most Valuable Professional
Most Valuable Professional

If you've made any changes to the flow recently that is probably the problem.  When you do a regularly triggered flow it checks the authentication of the flow connectors when you start the flow.  But when you launch a flow from a Power App it authenticates the connectors when you first launch the Power App.  The problem is that if you later change the flow parameters or connectors then Power Apps doesn't know to re-request authentication.  Try removing the Flow, save and publish, and then re-add it into the Power App.  You should get an oauth request when you launch the Power App that includes the connectors for the flow.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Have the same problem. Passing string value through PowerApps trigger and then calling a CDS action (List in this case) and it's erroring with Unauthorized. Did some hacking around and if you turn Concurrency Control setting on for PowerApps trigger and then set the List action to Async it will work in test and return a value through Response to PowerApps action. What's broken now for me, however, is the Response action that I was using to return a JSON array now no longer returns (even though when I test it, I can see that it gets the data).

I'm now getting this issue as well with a flow triggered by a button in a canvas app, which is embedded into a model driven form. 

 

I've tried @Pstork1 's suggestion of removing the flow from the app, saving and publishing it and then adding the flow back, but I still get the same issue - the Get record CDS current environment action is given the correct record id by the Power Apps trigger but it can't get the actual record.

 

The error message text is:

{"statusCode":401,"headers":{"x-ms-service-request-id":"d0100d2e-337a-4225-8476-48f447166de6,8ecb33b3-5905-4415-93c8-6c3cd6013a18","Set-Cookie":"ARRAffinity=419ae23f118f21674ab1e97561491a01f2c13ead6792ebae5fbc1431abcd355f; domain=org4cadf9a9.crm11.dynamics.com; path=/; secure; HttpOnly,ReqClientId=ea2c972c-af30-465f-ba98-50de5b9bb60f; expires=Sun, 27-Jul-2070 11:34:37 GMT; path=/; secure; HttpOnly; samesite=none,ARRAffinity=419ae23f118f21674ab1e97561491a01f2c13ead6792ebae5fbc1431abcd355f; domain=org4cadf9a9.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://org4cadf9a9.crm11.dynamics.com/","Strict-Transport-Security":"max-age=31536000; includeSubDomains","REQ_ID":"8ecb33b3-5905-4415-93c8-6c3cd6013a18","AuthActivityId":"76b2a12f-2d26-48fe-9362-09df0937f028","NativeWebSession-Version":"2","X-Source":"802161491481472041374347217250612432378542127206017227119854747119910416216320112,2042147619211523911641832317369521882138020201162141918423210015523318563194167239138","Public":"OPTIONS,GET,HEAD,POST","Timing-Allow-Origin":"*","Date":"Mon, 27 Jul 2020 11:34:36 GMT","Content-Length":"0","Allow":"OPTIONS,GET,HEAD,POST"}}

And here is the flow:

Capture.JPG

Has anyone got any ideas?

 

Thanks!

 

Simon

 

JarnoLucaAUG
Frequent Visitor

Same issue over here.

I have created a power app to enrol tenants. When the tenant status changes, the person responsible should be notified through email and an event in their outlook agenda.
When clicking the button, a flow is triggered which uses Common Data Service (current environment). Worked fine until 4 weeks ago, when suddenly the Flow stopped working with the Unauthorised CDS error.

 

Hi @JarnoLucaAUG 

 

I've posted my issue on a separate post https://powerusers.microsoft.com/t5/Building-Flows/Button-triggered-flow-Get-Record-action-failing-a... along with some extra points I discovered - but no fix yet.

 

Yesterday I raised a support ticket so I'll update you if/when I hear back from them!

 

Simon

Hi @sdowse 

 

I raised the issue with MS support in the end, and they told me it was because I had my app and Power Apps triggered Flow inside of a solution. It seems the CDS actions weren't working properly inside the solution, not giving the option to select an environment. Although they default to 'current' this wasn't working. Support basically confirmed there are some bugs with Power Apps triggered Flows inside solutions right now and to create them outside.

 

However this didn't work for me either, as half the CDS actions disappeared (I'm also needing get file or image content). This seemed to keep changing over the last week or so, sometimes they are there, and sometimes not, in and out of solutions. Our use case was to retrieve a document from a file field in a CDS entity. As we had to get our app over to a client we ended up switching to storing the documents in a SharePoint library, and tagging them with the name of our records to be able to query them via Flow. This is working but it is a rubbish workaround as means we have to tell users to upload files elsewhere and manually tag. This isn't going to help for other requirements though, it was lucky there was an alternative in this case.

 

It just seems the CDS actions are too buggy right now, and we couldn't run the risk of it working again one day and then breaking the next. In our environment now we can see the 'environment' drop down on the CDS actions again but after reworking once already I'd like to see a bit more evidence it is definitely working before switching back!

 

It's a shame though and quite frustrating when things work one day and randomly break a day or two later.

Hi @thunderstorm654 

 

Thanks for the update - that's really useful.

 

So I think the "normal" CDS actions are working (they are the ones that let you choose the environment - but of course when you export your solution to a different environment (i.e. test or production) you then have to update every single action to point to the new environment 🙄) but it is the "CDS (current environment)" actions which are broken - you can only use (and access) these actions from within a solution, so it is not helpful that MS support are telling you that the problem is that you are using them inside a solution! These are the ones that don't let you choose an environment, as they are just meant to use the environment they find themselves in.

 

Like you, I need some of the extra actions available with the CDS (current environment) (and I'd rather not spend hours updating loads of actions when I export my solution, as mentioned above), so it is a bit of a pain!

 

Thanks again!

 

Simon

 

@thunderstorm654 @JarnoLucaAUG @CharlieHowURun 

 

Apparently MS are working on it....

 

Capture.JPG

Awesome! Glad to hear that Microsoft knows of this issue.

 

Also thanks for keeping us in the loop and creating the ticket! I was planning on doing the same.

 

I've also posted some little tests and their results on your separate thread. I'm planning some more expanded tests next week. 

 

By the way, for a potential workaround, do you need a response from the Flow to your Power App?

I've considered changing the logic of my Flow to use the "when a record is created trigger" because my Power app doesn't need feedback. 

Though, it would also need the current environment connector, because I need to export the solution to the Company environment for testing. Which means this could potentially cause some errors as well.
I'm planning on trying the "when a record is created trigger" next week, then I'll post the results of that as well. 

 

This worked for me and was very easy to get working for me.

I had made an update to a part of the flow which then broke due to unauthorised, following this process got it working again.

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages