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 / Get the file from docu...
Power Automate
Answered

Get the file from document library and upload to a sharepoint list specific row

(0) ShareShare
ReportReport
Posted on by 29

Hello, is it possible when a new item is created on a sharepoint list, it will check the document library for the pdf file with a unique file name that is same with the item on title column on the sharepoint list and get the pdf file to upload it to the attachment column of the sharepoint list? Thanks!

Categories:
  • Verified answer
    Manish Solanki Profile Picture
    15,169 Moderator on at

    Hi @NigusInPajamas 

     

    Here is the sample flow.

     

    1. Add trigger "When an item is added" and set the site URL & list name. In this example, I have taken 'SampleList' as custom list:

    ManishSolanki_0-1700669837240.png

     

    2. Next, add "Get files (properties only)" action to lookup the file in document library based on the title column field. We could achieve this by using filter query. Here I am looking for a pdf file in default Documents library:

    ManishSolanki_1-1700670020313.png

    Filter query:

    FileLeafRef eq '@{triggerOutputs()?['body/Title']}.pdf'

    If title contains file extension (.pdf) then you need to remove it in the above filter query. You could copy it & paste this query directly in your flow.

     

    3. Add "Apply to each" action, pass the value object from get file properties as its input. Inside it, add 'Get file content' to get the file content from SharePoint library:

    ManishSolanki_3-1700670307354.png

     

    Finally, add "Add attachment" action to attach the file to the list item:

    ManishSolanki_4-1700670771234.pngManishSolanki_5-1700670863988.png

    ManishSolanki_6-1700670940718.png

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 302 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 263

#3
Henil Profile Picture

Henil 115

Last 30 days Overall leaderboard