Skip to main content

Notifications

Power Automate - Building Flows
Answered

Email only 1 attachment from Sharepoint list based on file name

Like (2) ShareShare
ReportReport
Posted on 10 Sep 2024 22:55:28 by 10
I have a Sharepoint list where items can have multiple attachments.  I have a flow that works successfully that sends an email when a certain field in the Sharepoint list is changed.  However, it sends ALL of the file attachments that are on that Sharepoint list item in the email.  What I want is for it to only send the file attachment that has "DRAFT" in its file name.  Currently I have my AttachmentArray variable in the Attachments field in the Send an email component which sends all of the attachments.  Below is a snippet of my current flow.
 
I have tried what I thought would work, as well as a few different things I found on posts but I have not been successful.  Does anyone have any tips so that not all attachments are sent, just the one that I want?
 
  • cmaly Profile Picture
    cmaly 10 on 12 Sep 2024 at 22:18:03
    Email only 1 attachment from Sharepoint list based on file name
    FLMike thanks so much for your quick reply.  I was able to try it out tonight and that was exactly what I needed.  I was obvioulsy putting my condition in the wrong spot in all of my trial and errors.  Much appreciated!!
  • Verified answer
    FLMike Profile Picture
    FLMike 29,371 on 10 Sep 2024 at 23:37:55
    Email only 1 attachment from Sharepoint list based on file name
    Hi
     
     
    I am assuming that your first For Each is looping through the Attachments of the Item??
     
    If so, then inside of it, dont get the Content
     
    First put a condition
     
    left side = the DisplayName dynamic property
    middle = contains
    right side = whatever string you want (hard code it, make it environment variable whatever)
     
    Inside the yes, add it to your Array
     
    otherwise skip the rest
     
    Cheers,
     
     
     
     
     

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #9 Get Recognized…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,367

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,297

Leaderboard
Loading started
Loading complete