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

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

File attachment from a form breaks when attached in approval

(0) ShareShare
ReportReport
Posted on by 20

Hi Community,

I have been trying to attach a form submission file in an approval. For some reason it seems to work for the first approval in the chain and the file is accessible. In the second approval further down in the process the attachment is corrupted and has increased in size from 20 to 27 kb. Technically, it has the same name but has changed for some reason.

 

I have followed this approach in order to avoid the issue with the content bytes: https://powerusers.microsoft.com/t5/General-Power-Automate/Flow-attachment-Error/m-p/1348202#M81123

I have also created two variables - the first one for the emails and the second one for the approvals. 

 

LazarPetkov_0-1659365031343.png

The JSON is formatted as follows:

LazarPetkov_1-1659365228631.png

In addition, I also tried to format the content as 

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

 

LazarPetkov_2-1659365493249.png

The approvals are configured as First to Approve and the file which causes the issue in the second approval is attached in both Approval steps as a dynamic variable. I just can`t figure out why it works only for the first attachment and not for the second one.

Best Regards,
Lazar

I have the same question (0)
  • Ellis Karim Profile Picture
    11,465 Super User 2025 Season 2 on at
    Re: File attachment from a form breaks when attached in approval

    Hi @LazarPetkov ,

     

    I use the following format for the attachment arrays (with the attachment taken from a Forms submission):

    Snag_1d6544c.png

     

    Please provide a screen shot fo the flow for the Approval actions.

     

    See also: How to send Microsoft Forms file uploads to an Approval workflow using Power Automate – Ellis Karim's Blog

     


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

  • LazarPetkov Profile Picture
    20 on at
    Re: File attachment from a form breaks when attached in approval

    Hi Ellis,

    I am using an Apply to each action in order to extract all files in case of multiple attachments.

    LazarPetkov_0-1659429328135.png

    My approval action looks like that:

     

    {
    "name": @{items('Apply_to_each_RnRTemplate')?['name']},
    "content": @{body('Get_file_content_using_path_2')}
    }

  • Ellis Karim Profile Picture
    11,465 Super User 2025 Season 2 on at
    Re: File attachment from a form breaks when attached in approval

    Hi @LazarPetkov ,

     

    Please confirm:

     

    (1) The issue is that the attchment array works for approval 1. The same attachment array (attachment_approvals_2) does not work for approval 2?

     

    (2) The file or files that are being attached to the approval workflow are coming from a Microsoft Forms submission? The screenshot shows you are getting files from SharePoint.

     

    (3) Please show the approval actions for both actions and confirm that they are using the same array:

     

    ekarim2020_0-1659429884679.png

     

    Can you share the entire flow?

     


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

     

  • LazarPetkov Profile Picture
    20 on at
    Re: File attachment from a form breaks when attached in approval

    Hi Ellis,

     

    (1) The issue is that the attachment array works for approval 1. The same attachment array (attachment_approvals_2) does not work for approval 2? - That is correct. Identical attachment array works in one approval action it does not in another.

     

    (2) The file or files that are being attached to the approval workflow coming from a Microsoft Forms submission? The screenshot shows you are getting files from SharePoint. - That is also correct. In the parse JSON action, I have selected the output from the upload question in the form. Then I am extracting the files using the output from the JSON in the Apply to each action. This is a quite common approach.

    LazarPetkov_1-1659431368705.png

    LazarPetkov_8-1659432192200.png

     

    LazarPetkov_7-1659432166613.png

    (3) Please show the approval actions for both actions and confirm that they are using the same array:

     

    Approval Step 1:

    LazarPetkov_4-1659431708422.png

    Approval Step 2:

    LazarPetkov_5-1659431779035.png

    Unfortunately, I will not be able to share the flow as there may be confidential company-owned information in it.

     

    Best Regards,
    Lazar

     

     



  • Ellis Karim Profile Picture
    11,465 Super User 2025 Season 2 on at
    Re: File attachment from a form breaks when attached in approval

    They look identical.

     

    As a test, can you (1) remove the attachment array from approval action TRHA0vYzZs, (2) save the flow, (3) then add the attachment array to the flow again:

     

    Snag_29ea882c.png

    Is it an option for you to delete the action TRHA0vYzZs and thenre-create it?

     

    Some times actions in flows do get corrupted and an easy solution is to delete the action and re-add it, or to save a new copy of the flow and test this new version.

     

     

    Ellis

  • LazarPetkov Profile Picture
    20 on at
    Re: File attachment from a form breaks when attached in approval

    Hi Ellis,

    I have already tried to remove and add the attachment variable again and that approach did not have any effect on the issue. 

    Rebuilding the approval would require a lot of work since I am using some of the output attributes from it the next steps. E.g. Update a Row where I extract the Approval Date, Approver`s name, comments, etc.

     

    LazarPetkov_0-1659441043187.png

    LazarPetkov_1-1659441128957.png

    The above snippets are from my outlook. The approvals that were generated. Note that the size is different and while the first file opens without a problem the second appears to be corrupted.

    Best Regards,

    Lazar

  • Ellis Karim Profile Picture
    11,465 Super User 2025 Season 2 on at
    Re: File attachment from a form breaks when attached in approval

    This is a demo flow I ran. The flow has two approval actions both approcl actions are using the same attachment array:

     

    Snag_2a2fc9f8.png

    These are the approval emails:

    Snag_2a3174ca.png

    Snag_2a319e4b.png

     

    Flow setup based on: How to send Microsoft Forms file uploads to an Approval workflow using Power Automate – Ellis Karim's Blog

     


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

  • LazarPetkov Profile Picture
    20 on at
    Re: File attachment from a form breaks when attached in approval

    Hi Ellis,

     

    I spent too many hours trying to figure out what the issue is. The funny thing is that the method that I have used works in other flows that I have. It causes problems only with this approval. I will try your method of file extraction and see if this would fix the issue. Would you mind sharing the flow with me? 

     

    Best Regards,
    Lazar

  • Ellis Karim Profile Picture
    11,465 Super User 2025 Season 2 on at
    Re: File attachment from a form breaks when attached in approval

    Hi @LazarPetkov ,

     

    The flow is the same as in this post but with an addition of a condition and second approval action:

    How to send Microsoft Forms file uploads to an Approval workflow using Power Automate – Ellis Karim's Blog

     


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

  • LazarPetkov Profile Picture
    20 on at
    Re: File attachment from a form breaks when attached in approval

    Hi Ellis,

    I will try it out and reply back later today. Cheers!\

     

    Best Regards,
    Lazar

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 722 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 461 Moderator

#3
developerAJ Profile Picture

developerAJ 283

Last 30 days Overall leaderboard