Skip to main content

Notifications

Power Automate - Using Flows
Unanswered

send email with a specific attachment from SharePoint list

(1) ShareShare
ReportReport
Posted on by 36

Hi,

 

I made a flow that will send email of stored attachments in SharePoint list as email when a value in SharePoint list is modified.

 

what is happening now that i will get all stored attachment in SharePoint.

 

my goal is to get only the latest added attachment when the value in SharePoint list is modified. 

my flow is running like bellow:

Sara_Salim_0-1652264398868.png

 

Sara_Salim_1-1652264448902.png

Sara_Salim_2-1652264489596.png

 

 

what I can modify in this flow that will help me to get only the latest added attachment in the list. 

i have tried also to use  last(outputs('Get_attachments')?['body'])?['Id']  as ID in get attachment content 

 

thank you

  • afjara04 Profile Picture
    afjara04 11 on at
    Re: send email with a specific attachment from SharePoint list

    Hi Rhia,

    Could you show your observations in the flow?, it is not so clear to me,

    thanks

  • Re: send email with a specific attachment from SharePoint list

    I think the first paragraph solution should work. As currently her array is taking everything from her data source. But getting the path of the last modified document by date yyyyMMddhhmmss should at least get you the data you want to retrieve 

  • Rhiassuring Profile Picture
    Rhiassuring 8,688 on at
    Re: send email with a specific attachment from SharePoint list

    Hmm, it seems like (tested on my side) attachments come back to us in alpha-order by name, and their ID is only an encoded path.

    So I think what you'd need to do, rather than use "Last" (as that will always just get the furthest down the alphabet line), is - use "Get File Metadata Using Path" and point it at the "AbsoluteUri" output from your "Get Attachments" action. From here, you can see the "LastModified" date - so if you collect the filename and the LastModified into an array, then you should be able to figure out which is the most recent, and only send that one.

    Or, if that's a bit much, you could make another column and just add the filename of the attachments that have been sent. Ie, Bird.PNG is added, gets sent - add Bird.PNG; to a multi-line of text column against that item. Someone adds Cat.PNG - flow runs, checks if the attachment added is present in the MLT, if not, sends attachment, adds Cat.PNG to the MLT. 

    Cheers,

     

    Rhia

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,422

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,711

Leaderboard

Featured topics

Restore a deleted flow