Skip to main content

Notifications

Power Automate - Building Flows
Answered

Error during Approval step; InvalidRequestContent

(0) ShareShare
ReportReport
Posted on by 44

Hi all,

 

I've been building flows for my company for a while now.  They have been mostly really simple approval flows for different processes. 

The flow I'm having problems with gets triggered when a new item is created in a Sharepoint List.  It's supposed to get the attachments from the record and start an approval process.  I have this same process working in another flow with no issues.

I use the approach to get contents and attach them to the approval from this post How to get Get Attachment into power automate - Microsoft Tech Community

 

I'm getting this error during the Start and wait for an approval step on my flow:

The request failed. Error code: 'InvalidRequestContent'. Error Message: 'The request content was invalid and could not be deserialized: 'Unexpected character encountered while parsing value: {. Path 'attachments[0].Content', line 1, position 1002.'.'.

 

From the error I gather that there's something going on with the attachments (variable) but I'm not sure where to go from here.

I use the same set of steps to get attachments and content on both flows, but only one of them is working.  I also tried testing with the same attachment on the 2 different flows just in case but same result.  Here are 2 snips of the different flows.  One fails and the other one doesn't.

 

Flow 1 with an errorFlow 1 with an errorFlow 2 with no errorsFlow 2 with no errors

 

 

Any help on how to understand the error itself and troubleshoot it is greatly appreciated

 

**Edit**

Here's a couple of snips on the steps to get attachments, apply to each, start and wait for approval:

Get atttachmentsGet atttachmentsApply to eachApply to eachStart and wait for an approvalStart and wait for an approval

  • EnochStrok Profile Picture
    EnochStrok 57 on at
    Re: Error during Approval step; InvalidRequestContent

    Thank you WXu43! This solved my problem after trying the above solutions for about 1 hour!

  • WXu43 Profile Picture
    WXu43 6 on at
    Re: Error during Approval step; InvalidRequestContent

    The same problem happened to me, and it was solved by referring to this link.

     

    Solved: The request content was invalid and could not be d... - Power Platform Community (microsoft.com)

    {
    "name":DisplayName,
    "content": base64(body('Get_attachment_content'))
    }

     

     

     

  • Pstork1 Profile Picture
    Pstork1 64,420 on at
    Re: Error during Approval step; InvalidRequestContent

    You are correct it should work for any file type but you never know.  It should definitely work for PDFs.  I've never seen the code on the trigger either.  Maybe that was from an older format.

  • Verified answer
    AG-20121725-0 Profile Picture
    AG-20121725-0 44 on at
    Re: Error during Approval step; InvalidRequestContent

    I ended up re-creating the flow and tried a few different things along the way.  A couple of things I learned from this whole ordeal...

    • I'm not sure if this is what was causing the issue in the first place but the old flow that was failing shows a different setting on the trigger step (even though it's supposed to be the same step 'When an item is created on SP').  I checked a few of my other flows and none of them have this setting.  Not sure if anyone can shed some light on this:
      Left side shows the setting on the old flow that was failingLeft side shows the setting on the old flow that was failing
    • When re-creating the flow I tried using 'ContentBytes' but it still didn't work.  Neither did  'Content'.  For some reason it only worked with 'content' which is how I have it in the other working flow

     

    @Pstork1 - All the attachments are PDF files, but there are no restrictions in case someone tried to submit a different format.  I thought get attachment content step would work for any format, is this not the case?

  • Pstork1 Profile Picture
    Pstork1 64,420 on at
    Re: Error during Approval step; InvalidRequestContent

    You are correct.  AS stated in that thread its a bug.  It should be contentBytes, but something in the approval action was coded wrong.  So we are back to the original problem.  What kinds of files are in the attachments?

  • AG-20121725-0 Profile Picture
    AG-20121725-0 44 on at
    Re: Error during Approval step; InvalidRequestContent

    I tried changing from 'Content' to 'ContentBytes' and now getting a different error.  I found this post suggesting that any attachments in the approval step don't work with 'ContentBytes' only with 'Content' (if I understood correctly) Solved: Power Automate approval with Attachments - Power Platform Community (microsoft.com)

     

    Here are the snips showing the update in the flow and new error:

    Update w/ContentBytesUpdate w/ContentBytesNew errorNew error

     

    I'm going to try and create the flow from scratch again...

  • Pstork1 Profile Picture
    Pstork1 64,420 on at
    Re: Error during Approval step; InvalidRequestContent

    I'm not sure why the one works with it set up that way.  But in your attachment array it should be 'ContentBytes': not 'Content':.  I've seen that cause the array to fail in the past.

  • AG-20121725-0 Profile Picture
    AG-20121725-0 44 on at
    Re: Error during Approval step; InvalidRequestContent

    Hi, thank you for looking into this.  I've added some snips to the original post.

  • Pstork1 Profile Picture
    Pstork1 64,420 on at
    Re: Error during Approval step; InvalidRequestContent

    Would you show us what the Apply to each and approval configuration looks like in the one that fails?

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

End of Year Newsletter…

End of Year Community Newsletter…

Tuesday Tip #12 Start your Super User…

Welcome to a brand new series, Tuesday Tips…

Tuesday Tip #11 New Opportunities…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,609

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,420

Leaderboard