cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
thunderstorm654
Regular Visitor

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.
CharlieHowURun
New Member

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 Roundup: A Look Back at Our Last 10 Tuesday Tips

As we continue to grow and learn together, it's important to reflect on the valuable insights we've shared. For today's #TuesdayTip, we're excited to take a moment to look back at the last 10 tips we've shared in case you missed any or want to revisit them. Thanks for your incredible support for this series--we're so glad it was able to help so many of you navigate your community experience!   Getting Started in the Community An overview of everything you need to know about navigating the community on one page!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Ranks and YOU Have you ever wondered how your fellow community members ascend the ranks within our community? We explain everything about ranks and how to achieve points so you can climb up in the rankings! Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Powering Up Your Community Profile Your Community User Profile is how the Community knows you--so it's essential that it works the way you need it to! From changing your username to updating contact information, this Knowledge Base Article is your best resource for powering up your profile. Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Blogs--A Great Place to Start There's so much you'll discover in the Community Blogs, and we hope you'll check them out today!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Unlocking Community Achievements and Earning Badges Across the Communities, you'll see badges on users profile that recognize and reward their engagement and contributions. Check out some details on Community badges--and find out more in the detailed link at the end of the article! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Blogging in the Community Interested in blogging? Everything you need to know on writing blogs in our four communities! Get started blogging across the Power Platform communities today! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Subscriptions & Notifications We don't want you to miss a thing in the community! Read all about how to subscribe to sections of our forums and how to setup your notifications! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Getting Started with Private Messages & Macros Do you want to enhance your communication in the Community and streamline your interactions? One of the best ways to do this is to ensure you are using Private Messaging--and the ever-handy macros that are available to you as a Community member! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Community User Groups Learn everything about being part of, starting, or leading a User Group in the Power Platform Community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Update Your Community Profile Today! Keep your community profile up to date which is essential for staying connected and engaged with the community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Thank you for being an integral part of our journey.   Here's to many more Tuesday Tips as we pave the way for a brighter, more connected future! As always, watch the News & Announcements for the next set of tips, coming soon!    

Calling all User Group Leaders and Super Users! Mark Your Calendars for the next Community Ambassador Call on May 9th!

This month's Community Ambassador call is on May 9th at 9a & 3p PDT. Please keep an eye out in your private messages and Teams channels for your invitation. There are lots of exciting updates coming to the Community, and we have some exclusive opportunities to share with you! As always, we'll also review regular updates for User Groups, Super Users, and share general information about what's going on in the Community.     Be sure to register & we hope to see all of you there!

April 2024 Community Newsletter

We're pleased to share the April Community Newsletter, where we highlight the latest news, product releases, upcoming events, and the amazing work of our outstanding Community members.   If you're new to the Community, please make sure to follow the latest News & Announcements and check out the Community on LinkedIn as well! It's the best way to stay up-to-date with all the news from across Microsoft Power Platform and beyond.    COMMUNITY HIGHLIGHTS   Check out the most active community members of the last month! These hardworking members are posting regularly, answering questions, kudos, and providing top solutions in their communities. We are so thankful for each of you--keep up the great work! If you hope to see your name here next month, follow these awesome community members to see what they do!   Power AppsPower AutomateCopilot StudioPower PagesWarrenBelzDeenujialexander2523ragavanrajanLaurensMManishSolankiMattJimisonLucas001AmikcapuanodanilostephenrobertOliverRodriguestimlAndrewJManikandanSFubarmmbr1606VishnuReddy1997theMacResolutionsVishalJhaveriVictorIvanidzejsrandhawahagrua33ikExpiscornovusFGuerrero1PowerAddictgulshankhuranaANBExpiscornovusprathyooSpongYeNived_Nambiardeeksha15795apangelesGochixgrantjenkinsvasu24Mfon   LATEST NEWS   Business Applications Launch Event - On Demand In case you missed the Business Applications Launch Event, you can now catch up on all the announcements and watch the entire event on-demand inside Charles Lamanna's latest cloud blog.   This is your one stop shop for all the latest Copilot features across Power Platform and #Dynamics365, including first-hand looks at how companies such as Lenovo, Sonepar, Ford Motor Company, Omnicom and more are using these new capabilities in transformative ways. Click the image below to watch today!   Power Platform Community Conference 2024 is here! It's time to look forward to the next installment of the Power Platform Community Conference, which takes place this year on 18-20th September 2024 at the MGM Grand in Las Vegas!   Come and be inspired by Microsoft senior thought leaders and the engineers behind the #PowerPlatform, with Charles Lamanna, Sangya Singh, Ryan Cunningham, Kim Manis, Nirav Shah, Omar Aftab and Leon Welicki already confirmed to speak. You'll also be able to learn from industry experts and Microsoft MVPs who are dedicated to bridging the gap between humanity and technology. These include the likes of Lisa Crosbie, Victor Dantas, Kristine Kolodziejski, David Yack, Daniel Christian, Miguel Félix, and Mats Necker, with many more to be announced over the coming weeks.   Click here to watch our brand-new sizzle reel for #PPCC24 or click the image below to find out more about registration. See you in Vegas!       Power Up Program Announces New Video-Based Learning Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram. These include a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the image below to find out more!   UPCOMING EVENTS Microsoft Build - Seattle and Online - 21-23rd May 2024 Taking place on 21-23rd May 2024 both online and in Seattle, this is the perfect event to learn more about low code development, creating copilots, cloud platforms, and so much more to help you unleash the power of AI.   There's a serious wealth of talent speaking across the three days, including the likes of Satya Nadella, Amanda K. Silver, Scott Guthrie, Sarah Bird, Charles Lamanna, Miti J., Kevin Scott, Asha Sharma, Rajesh Jha, Arun Ulag, Clay Wesener, and many more.   And don't worry if you can't make it to Seattle, the event will be online and totally free to join. Click the image below to register for #MSBuild today!   European Collab Summit - Germany - 14-16th May 2024 The clock is counting down to the amazing European Collaboration Summit, which takes place in Germany May 14-16, 2024. #CollabSummit2024 is designed to provide cutting-edge insights and best practices into Power Platform, Microsoft 365, Teams, Viva, and so much more. There's a whole host of experts speakers across the three-day event, including the likes of Vesa Juvonen, Laurie Pottmeyer, Dan Holme, Mark Kashman, Dona Sarkar, Gavin Barron, Emily Mancini, Martina Grom, Ahmad Najjar, Liz Sundet, Nikki Chapple, Sara Fennah, Seb Matthews, Tobias Martin, Zoe Wilson, Fabian Williams, and many more.   Click the image below to find out more about #ECS2024 and register today!     Microsoft 365 & Power Platform Conference - Seattle - 3-7th June If you're looking to turbo boost your Power Platform skills this year, why not take a look at everything TechCon365 has to offer at the Seattle Convention Center on June 3-7, 2024.   This amazing 3-day conference (with 2 optional days of workshops) offers over 130 sessions across multiple tracks, alongside 25 workshops presented by Power Platform, Microsoft 365, Microsoft Teams, Viva, Azure, Copilot and AI experts. There's a great array of speakers, including the likes of Nirav Shah, Naomi Moneypenny, Jason Himmelstein, Heather Cook, Karuana Gatimu, Mark Kashman, Michelle Gilbert, Taiki Y., Kristi K., Nate Chamberlain, Julie Koesmarno, Daniel Glenn, Sarah Haase, Marc Windle, Amit Vasu, Joanne C Klein, Agnes Molnar, and many more.   Click the image below for more #Techcon365 intel and register today!     For more events, click the image below to visit the Microsoft Community Days website.      

Tuesday Tip | Update Your Community Profile Today!

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   We're excited to announce that updating your community profile has never been easier! Keeping your profile up to date is essential for staying connected and engaged with the community.   Check out the following Support Articles with these topics: Accessing Your Community ProfileRetrieving Your Profile URLUpdating Your Community Profile Time ZoneChanging Your Community Profile Picture (Avatar)Setting Your Date Display Preferences Click on your community link for more information: Power Apps, Power Automate, Power Pages, Copilot Studio   Thank you for being an active part of our community. Your contributions make a difference! Best Regards, The Community Management Team

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Super User of the Month | Ahmed Salih

We're thrilled to announce that Ahmed Salih is our Super User of the Month for April 2024. Ahmed has been one of our most active Super Users this year--in fact, he kicked off the year in our Community with this great video reminder of why being a Super User has been so important to him!   Ahmed is the Senior Power Platform Architect at Saint Jude's Children's Research Hospital in Memphis. He's been a Super User for two seasons and is also a Microsoft MVP! He's celebrating his 3rd year being active in the Community--and he's received more than 500 kudos while authoring nearly 300 solutions. Ahmed's contributions to the Super User in Training program has been invaluable, with his most recent session with SUIT highlighting an incredible amount of best practices and tips that have helped him achieve his success.   Ahmed's infectious enthusiasm and boundless energy are a key reason why so many Community members appreciate how he brings his personality--and expertise--to every interaction. With all the solutions he provides, his willingness to help the Community learn more about Power Platform, and his sheer joy in life, we are pleased to celebrate Ahmed and all his contributions! You can find him in the Community and on LinkedIn. Congratulations, Ahmed--thank you for being a SUPER user!

Users online (3,895)