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 / Send Attachment Based ...
Power Automate
Answered

Send Attachment Based on DropDown

(0) ShareShare
ReportReport
Posted on by

I have a Power App connected to a SP List, and one of the fields is a dropdown.  I want to send an email with an attachment based on the dropdown choice.  The files are housed in a Document Library on the same SP site as the List.  Or I can make a new List with the attachments.   E.g. If Toyota is selected in the dropdown, I want to attach the Toyota.docx file to the Email.  I've named all the files the same name as the dropdown choices.  The Power Automate I'm using is triggered by 'When a new item is created'. Is this possible? Thanks!  

Categories:
I have the same question (0)
  • v-dezhili-msft Profile Picture
    Microsoft Employee on at

    Hi @theBrianL ,

     

    I have a test for your reference.

    In my scenario, my fileName column is a radio selection column, which has three options corresponding to the file names of the three files in my SPfile folder.

    vdezhilimsft_1-1676532186800.png

    vdezhilimsft_3-1676532222647.png

     

     

    vdezhilimsft_0-1676532135603.png

    vdezhilimsft_4-1676532242492.png

    vdezhilimsft_5-1676532278793.png

    vdezhilimsft_6-1676532307773.png

    vdezhilimsft_7-1676532337587.png

     

    Best Regards,

    Dezhi

     

     

     

     

     

     

  • theBrianL Profile Picture
    on at

    Thank you for posting.  However, it attaches all of the files no matter which drop-down choice is selected.  I don't see anything in the flow that is specifically looking for the drop-down value in the field called 'Category'?  Also, not all categories have an associated file so would like it to not attach anything if there is no related file.  

    theBrianL_0-1676581406951.png

     

  • theBrianL Profile Picture
    on at

    Not sure how yours only attaches one file?  I rebuilt a test flow exactly like you have it and it still sends all of the attachments. 

  • Verified answer
    v-dezhili-msft Profile Picture
    Microsoft Employee on at

    Hi @theBrianL ,

     

    I'm very sorry for my mistake, I lost the most important part in my screenshot. We need to use the substringof() formula in the filter query to find the corresponding file in the folder according to the options in the item. Apologize again.

    vdezhilimsft_0-1676600369854.png

     

    Best Regards,

    Dezhi

  • theBrianL Profile Picture
    on at

    That worked for attaching just the correct file-thank you!   Now I'm getting this error I've never seen before when I try to open it:

    theBrianL_0-1676601811470.png

    I click Yes and then: 

    theBrianL_1-1676601879253.png

     

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

    Hi @theBrianL ,

     

    Do you include the correct suffix in your email attachments?
    What does the array you're using to hold the attachments look like?
    Could you please show some screenshots of your flow in edit mode?
    Sorry, I have never encountered this kind of error. You can try to create a new test flow and try to directly take a file in your folder and put it in an email attachment to see if it can be opened normally.

     

    Best Regards,

    Dezhi

  • theBrianL Profile Picture
    on at

     

    I can open the documents fine on the SP and open the documents on the desktop that I used to upload to SP. 

    theBrianL_2-1676604743315.pngtheBrianL_3-1676604907458.pngtheBrianL_4-1676605000614.png

     

  • theBrianL Profile Picture
    on at

    I figured it out.  I had selected 'Body' instead of Get File Contents in the Append to Array Variable.  It then changes it to 'Body'.  It's working now.  Thank you so much for your posts.  This is amazing! 

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!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 632

#2
Haque Profile Picture

Haque 458

#3
Valantis Profile Picture

Valantis 357

Last 30 days Overall leaderboard