Skip to main content

Notifications

Power Platform Community / Forums / Building Flows / Email only 1 attachmen...
Building Flows
Answered

Email only 1 attachment from Sharepoint list based on file name

Posted on 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 at
    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 26,301 on at
    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

September 2024 Newsletter…

September 2024 Community Newsletter…

Community Update Sept 16…

Power Platform Community Update…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 141,122

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,414

Leaderboard

Featured topics