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 / Power Automate to atta...
Power Automate
Unanswered

Power Automate to attach files (second level)

(0) ShareShare
ReportReport
Posted on by 290

Hi,

 

I have a Microsoft Form that requests answers for 5 text fields from respondents & allows attach 5 files.

I have a FLow to collect & email an acknowledge email attached with the 5 files uploaded to the form. Able to do this. Absolutely no problem till here.

 

Also, Flow adds these 5 text responses on the form to a spreadsheet & save it to one drive for business.

 

How can I include this spreadsheet to the above email? 

 

If this is all done right, the email should have attachments of the uploaded files & the Excel file.

 

Any tip & help on this is greatly appreciated.

 

Thanks

C1

 

 

Categories:
  • MattWeston365 Profile Picture
    1,701 on at

    Hi @cadone easiest thing to do is to use the ODFB action for Get File Content to grab the Excel spreadsheet. That can then be used in the attachment field in the send email action (assuming that you're using Outlook for O365). So when you fill the attachments content, set the attachment name to be the name of the file (including file extension) and the in the Attachment Content, use the File Content output from the Get File Content action.

  • cadone Profile Picture
    290 on at
    Matt,
     
    Thanks for the tip. Sounds easy enough. Will give it a shot and get back. Appreciate your help.
     
    C1
  • CFernandes Profile Picture
    8,504 Most Valuable Professional on at

    Hi @cadone,

     

    My solution to your problem.

     

    CFernandes_0-1597228869898.png

     

     

    Initialize a variable of type array:

     

    CFernandes_1-1597229005999.png

     

    Get all attachment (Contents) and create an Array for Attachments.

     

    CFernandes_2-1597229077825.png

     

    Outside the Loop the get the Excel file attachment and append it to the same array.

     

    CFernandes_3-1597229143634.png

     

    Send an email with all attachments.

     

    CFernandes_4-1597229184544.png

     

    You should have all attachment in your inbox

     

    CFernandes_5-1597229228336.png

     

    This is complete solution a little bit complicated but it works definitely.

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

     

     

     

     

     

     

     

  • cadone Profile Picture
    290 on at

    Thanks for the tip. I am trying the append outside the loop method first because my flow is very close.

    Thanks a lot. I think I am almost thru. i can see that the attachments are showing along with the amended Excel file. But I don't know why it's failing. thoughts? I have included the screen shots.

    cadone_0-1597238411476.png

    cadone_1-1597238437305.png

     

     

  • CFernandes Profile Picture
    8,504 Most Valuable Professional on at

    @cadoneContentBytes for the Excel attachment is missing.

     

    Outside the "Apply to each" loop:

     

    • Get file Content using path of your Excel File.
    • Append to the Name and ContentBytes to the same Array(Format below).

     

    {
     "Name": "Gift.xlsx",
     "ContentBytes": @{body('Get_file_content_using_path')?['body']}
    }

    CFernandes_1-1597243008655.png

    • Finally pass the Array to the 'Send an email' action.

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

     

  • cadone Profile Picture
    290 on at

    I am sorry to be bugging you guys. Still not resolved.

    I replaced the "Gift.xlsx" with the variable name. & included the CBytes also.

    See the screenshot.

    full.png

  • cadone Profile Picture
    290 on at

    This is crazy and overwhelming. I tried so many things that I am losing track of what I am doing.  It's "this close" but still not working. 

     

    Since I am seeing the correct excel file name under the append2, I am all excited. But the ContentsBytes is messed up. I tried pasting your suggestion.

    cadone_0-1597276794881.png

     

    When I do that, its bringing the "Form Body". When I run it, the flow is still failing.

    Later I replaced the name & content bytes for name & contents of many other steps. did not work.

     

    cadone_1-1597277856057.pngcadone_2-1597278241096.png

     

    Now I don't know where the error is. Any advice is appreciated. 

     

    I will parallelly try the ODFB solution to see if that helps.

    But don't know where to add that action? I guess it should also go after the "apply to each" loop.

     

    Thanks

    C1

     

     

  • cadone Profile Picture
    290 on at

    Matt,

    I couldn't try the ODFB action. This is because the excel file is stored in the sharepoint library. So I tried by adding the get file content 4 & append to array variable 2. Still not working. 

     

    cadone_0-1597286325687.png

     

  • CFernandes Profile Picture
    8,504 Most Valuable Professional on at

    @cadone Try using 'Get File Content using path'

     

    CFernandes_0-1597295578504.png

     

  • cadone Profile Picture
    290 on at

    please dont laugh.

     

    good news is that i was able get the excel file on email attachement. (felt great to see that email)

     

    bad news is i lost the array (attachments).

     

    How/where do i add "attachements" to the field. Can i add after the closing of "]" or should i add it before "]"

    cadone_0-1597299851947.png

    Should "attachments" be separated by a ",".

     

    can you help with that syntax.

     

     

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 425

#2
11manish Profile Picture

11manish 323 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard