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

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to select a file c...
Power Automate
Unanswered

How to select a file content in email attachment when multiple file contents are available

(0) ShareShare
ReportReport
Posted on by 4

Hello Everyone,

 

At first, I am generating different file contents in PDF format using OneDrive Convert File (Preview). That means, 1st file content(pdf) generated for Role1, 2nd file content(pdf) generated from Role2 and so on up to 5 roles.

 

Now I want to send an email with this file content as an attachment based on the current role. How can do that? Please guide on this.

 

Thank you in advance.

File Content .png
Categories:
I have the same question (0)
  • Rhiassuring Profile Picture
    8,690 Moderator on at

    You need to build an array of the attachments you wish to send, and then add them into the email after clicking the little "T" icon in the top right hand corner of the Attachments Name and Attachments Content panel.

     

    Here's a step-by-step to walk you through it:

     

    https://powerautomate.microsoft.com/en-us/blog/multiple-attachments-single-email/

     

     

  • v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @Anonymous9999 

    According to your description, you are using the OneDrive Convert File (Preview) to three files.

    For each operation, the corresponding fileContent will be generated, and you can choose the file Content you need to pass as "Attachments Content" according to your needs and you can input the file name in "Attachments Name":

    vyueyunmsft_0-1699327690610.png

    And if you want to pass more than one Attachment, you can click this to add the Attachments.

    vyueyunmsft_1-1699327731445.png

     

     

    If I misunderstand what you mean, you can describe your needs and your expected outcomes in detail so that we can better help you.


    Best Regards,

    Yueyun Zhang

     

  • Anonymous9999 Profile Picture
    4 on at

    Hello @Rhiassuring ,

     

    Thanks for responding. Your solution is helpful to some extent, I tried it and now stuck at one point. While doing the send an email with option, I am facing the following error "OpenApiOperationParameterValidationFailed. The 'inputs.parameters' of workflow operation 'Send_email_with_options' of type 'OpenApiConnectionWebhook' is not valid. Error details: The API operation 'SendMailWithOptions' is missing required property 'optionsEmailSubscription/Message/Attachments/0/ContentBytes'". Everything is working as expected at the Approval Step, but only problem with the send email one. Adding all the screenshot's, how my flow looks like. Thank you in advance. 

    Approval.png
    Array File Attachment.png
    Email Error.png
  • Rhiassuring Profile Picture
    8,690 Moderator on at

    It seems to think that the content is missing.

     

    I notice that in your screenshot, you're using a base64() expression, but in the article I sent you, they get the actual Attachment Content, and that's what goes into the array.

     

    I'm not sure why it's working for the Approval action you've shown, but I'd wager that you need to change it for the Email With Options.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 239 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 177 Super User 2026 Season 1

#3
Kalathiya Profile Picture

Kalathiya 97 Super User 2026 Season 1

Last 30 days Overall leaderboard