web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Power Automate Approva...
Power Automate
Answered

Power Automate Approvals with Attachments

(0) ShareShare
ReportReport
Posted on by 13

Hi, I have a flow that has been working fine for several years and has suddenly stopped working. It fails on a create and wait for an approval with a BadGateway 502 error.

I have narrowed this down to attachments. I am attaching multiple files by appending for each file:

 

 

{
 "Name": @{outputs('file_name')},
 "Content": @{body('get_attachment_content')}
}

 

 

I know this should be OK as I am using this same array to attach the items to a SharePoint list item.

When I remove the attachments array from the approval it works fine.

 

I have flows in other environments that are almost identical with no issue and no one has changed this flow for at least several months. 502 BadGateway doesn't seem a lot to to go on.

 

Very grateful for any ideas.

Categories:
I have the same question (0)
  • SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at

    @nick_90210 , How does your attachment array look like in the Flow history?

     

  • nick_90210 Profile Picture
    13 on at

    Thanks @SudeepGhatakNZ output looks like this. I have changed the $content for the post:

     

    {
     "Name": "filename.pdf",
     "Content": {
     "$content-type": "application/pdf",
     "$content": "JVBE... etc
     }
    }
  • Verified answer
    iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Hi, there was some information published about this on the 'Known issues' section of power platform admin portal, but this section is only currently available in the US.

     

    Details for the problem and workaround until they resolve the issue are the following:

     

     

    Problem

    You might encounter a BadGateway, 502, XrmApiServerError, 'Request to XRM API failed', or 'Principal user is missing prvReadAsyncOperation privilege' error when creating an approval.

     

    Workaround

    We are working on a fix for this issue.  In the meantime, you can resolve this issue by granting the "Approvals Administrator" role the missing privilege in the environment (please note that these actions need to be performed by an administrator). 

    To grant the "prvReadAsyncOperation" privilege:

    1. Go to Power Platform Admin Center (admin.powerplatform.microsoft.com)
    2. Select Environments
    3. Select the environment in which the error occurs
    4. Select Security Roles > See All
    5. Click the ellipsis (...) next to Approvals Administrator and select Edit
    6. Search for "asyncoperation" (aka "System Job") table (select "Show all tables" if not visible)
    7. Update the read permission to "Organization"

     

    Cheers,

    Sancho

  • Verified answer
    b1324 Profile Picture
    17 on at

    Hi Nick,.. see answer below from Sancho to add in the Administrator Approvals role -> Organization setting.

     

    I had the same issue.

  • nick_90210 Profile Picture
    13 on at

    Thanks all. This seems to have done the trick. Frustrating this has not been listed by MS as an issue here in the UK.

  • Siopold Profile Picture
    2 on at

    Have had a similar issue, not quite the same. I am using a PA which is being called from a Business Event in D365FO.
    It invokes the approval process for a Purch Req by accessing the Approval app in MS Teams. It then writes back to D365FO. Well it did write back to FO before but that has stopped now with an error which looks like its permissions related.
    'User assigned to an item cannot complete it'
    Has anyone seen this before? I am pretty sure it is linked to approval permissions.

    Regards

    D

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 237 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 176 Super User 2026 Season 1

#3
Power Platform 1919 Profile Picture

Power Platform 1919 96 Super User 2026 Season 1

Last 30 days Overall leaderboard