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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Inconsistency on Attac...
Power Automate
Answered

Inconsistency on Attachments in Approval Flow - Sometimes doesn't have attachment but still sends the approval request

(0) ShareShare
ReportReport
Posted on by 22

Hi Everyone,

 

I've been looking for answers to this issue but can't find one.

 

I have this flow with a sharepoint list which requires an approval. Each line item may have multiple attachment based on what is attached in sharepoint list.

 

Here is the attachment flow for your reference:

ebcoswh_1-1625736737838.png

 

Here it is in the Approval part.

ebcoswh_3-1625736884338.png

 

Unfortunately the problem is most of the time. it works. but sometimes it sends the approval but without attachment. Here is the sample scenario. I tried to check the actual flow and it picks up the attachments. however, it is not attached to the approval

ebcoswh_4-1625737013312.png

 

Not sure if the file name has something to do with this? Here are the file names in this flow any special characters that is not allowed? (Covered part is are just letters) I'm sure its not the file size because approval wont be sent if file size exceeds the limit.

ebcoswh_5-1625737155242.png

 

Appreciate any help. Thank you!

 

Categories:
  • Ellis Karim Profile Picture
    12,329 Super User 2026 Season 2 on at

    To send attachments along with a flow requires a different format as compared to sending attachments in Outlook.

    ekarim2020_0-1625760336384.png

     

    {
     "name": @{items('Apply_to_each')?['name']
     },
     "content": {
     "$content-type": @{items('Apply_to_each')?['contentType']},
     "$content": @{items('Apply_to_each')?['contentBytes']}
     }
    }

     

    ekarim2020_2-1625760776566.png

    Ellis

  • ebco-swh Profile Picture
    22 on at

    Thanks @ekarim2020 for the response

     

    The Append array variable. is giving me this result.

    ebcoswh_0-1625832593107.png

     

    the reason the flow fails

    ebcoswh_1-1625832637226.png

     

    I tried to change @{items('Apply_to_each')?['name'] with a dynamic content "Display Name" @{items('Apply_to_each')?['DisplayName']} which worked

     

    however was not able to find Content Type and ContentBytes. it still gives me a null result. is this expected?

    ebcoswh_2-1625832908502.png

     

  • ebco-swh Profile Picture
    22 on at

    @ekarim2020 sorry I just realized the attachment in your screenshot is coming from an outlook. mine is coming from a sharepoint list item.

  • Ellis Karim Profile Picture
    12,329 Super User 2026 Season 2 on at

    As long as we satisfy how the Approval expects us to send it attachments, the source of attachment doesn't matter.

    ekarim2020_0-1625855061778.png

    This the body of the content (which you can use in the expression) :

     

    {
     "name": outputs('Get_file_metadata')?['body/DisplayName'],
     "content": {
     "$content-type": body('Get_attachment_content')['body']['$content-type'],
     "$content": body('Get_attachment_content')['body']['$content']
     }
    }

     

     

    ekarim2020_1-1625855324063.png

     The content of varAttachment:

     

    ekarim2020_2-1625855458173.png

    This should also work for you.

    Ellis

  • ebco-swh Profile Picture
    22 on at

    I've added "Get file metadata" and used the codes you have provided. Unfortunately, it says that it is not a valid json. I cant seem to show content type and content as a dynamic content.

    ebcoswh_0-1626337247697.png

     

  • Ellis Karim Profile Picture
    12,329 Super User 2026 Season 2 on at

    The JSON value in Append to Array variable needs to be entered as Dynamic content:

    ekarim2020_1-1626340465528.png

    So your Append to array variable step should look like this, including the blue boxes (place-holder values):

    ekarim2020_4-1626341481329.png

    Ellis

  • ebco-swh Profile Picture
    22 on at

    I think that's where I'm having an issue. "Attachment Content Type" is not available on my dynamic content list. not sure why.

    ebcoswh_1-1626368453318.png

     

    Instead, i tried to use "MediaType" from the "Get File Metadata" action.

    ebcoswh_3-1626369813847.png

     

    Unfortunately, I cant open the file still

    ebcoswh_4-1626369872085.png

     

    Here's the raw inputs from the flow. i've seen that its creating another line for content-type

    ebcoswh_2-1626368979707.png

     

    just to share and not sure if it has to something to do with this. "Split on" is enabled in my trigger too.

     

     

  • Verified answer
    ebco-swh Profile Picture
    22 on at

    @ekarim2020 for some reason below code worked for me by simply copying it to the array. not sure what's the difference with the initial code you gave. but thank you so much for answering my questions. Feel free to let me know what went wrong with this so I will note moving forward. Thank you so much again!

     
    {
    "Name": "@{items('Apply_to_each')?['DisplayName']}",
    "content": {
    "$content-type": "@{body('Get_attachment_content')['$content-type']}",
    "$content": "@{body('Get_attachment_content')['$content']}"
    }
    }
  • Verified answer
    Ellis Karim Profile Picture
    12,329 Super User 2026 Season 2 on at

    It's actually the same code. The code can be entered manually along with Dynamic content:

    ekarim2020_2-1626374757476.png

    You can also copy and past the above code, as you see in the yellow rectangle below:

    ekarim2020_1-1626374559643.png

    The issue with code is that it was taken from my flow and it's possible that the code may not work in your flow without changes. This can be due to a number of reasons such as I am using different variable names, my Apply to each loop has a different name to yours, the copy-paste contains extra characters that may need to be removed in some situations e.g.  @{items('Apply_to_each')?['name']} modified to items('Apply_to_each')?['name'].

    Using Dynamic content will ensure you are using the correct content which is taken from your flow.

    Ellis

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 430

#2
11manish Profile Picture

11manish 341 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 282

Last 30 days Overall leaderboard