Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

Issue with attaching File Content from a instant cloud flow for a SharePoint List Item

(0) ShareShare
ReportReport
Posted on by 2

I'm trying to set up an instant cloud flow that I can trigger from a SharePoint List item which allows the user to input text and attach a file that will be dropped into an email generated during an action later in the flow. The issue I'm having is that the file provided during input is not being attached to the email in the correct format.

 

Here's a rundown of my flow:

 

Triggered from a selected SharePoint List item:

mbarron486_1-1664910903443.png

Get item action to retrieve data from the list to populate on the email

mbarron486_2-1664910956166.png

Send email action to populate an email with information from the List item and inputs from the trigger:

Text input from the trigger goes into the body

File Content input from the trigger goes in the Attachments

mbarron486_4-1664911055462.png

The flow is populating the Text input into the email body fine, but the attachment is coming through in an unknown file format and the name doesn't match the inputted file on the trigger:

 

mbarron486_5-1664911243900.png

I don't see any other Dynamic Content selections to choose from that would populate the attachment. Is there some addition action I need to do prior to the Email action to convert the file into an attachable format?

 

  • noodlz86 Profile Picture
    noodlz86 2 on at
    Re: Issue with attaching File Content from a instant cloud flow for a SharePoint List Item

    I came to this post hoping to find an answer - but through some trial and error, I figured it out so I'll share...

     

    The dynamic content from the instant flow trigger isn't available in the dynamic content list so you need to manually type it into the expression builder. Look at the raw output of the trigger:

    noodlz86_0-1697651545111.png

    Item 1 has the trigger inputs, the text and file fields. Item 2 has the list item fields which are available in the dynamic content dropdown and so, like me, you may have assumed fileName was the name of the file you're trying to attach but it is actually the name of the list item/'selected item'.

     

    You should use instead: 

    file name:  triggerBody()?['file']?['name']
    file content:  triggerBody()?['file']?['contentBytes']

     

  • CU15011838-0 Profile Picture
    CU15011838-0 2 on at
    Re: Issue with attaching File Content from a instant cloud flow for a SharePoint List Item

    So my scenario is a bit different than the one linked here. I'm not actually calling up an existing file that is already stored other on the List item or within a SharePoint document library, the file is being added by the user when the flow is being triggered:

    mbarron486_1-1664979053158.png

     

    The user is importing a local file as an input and I'm just trying to get that file attached to the email being sent by the flow. 

     

     

  • AS-06081019-0 Profile Picture
    AS-06081019-0 1,736 on at
    Re: Issue with attaching File Content from a instant cloud flow for a SharePoint List Item

    @mbarron486  Please refer this: https://learn.microsoft.com/en-us/microsoft-365/community/power-automate-send-sharepoint-files-as-attachments

    or https://youtube.com/watch?v=yy1z7cZ5Dac&feature=share&si=EMSIkaIECMiOmarE6JChQQ

     

     

    Thanks

    Ankesh

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,580

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,909

Leaderboard