web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

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:
I have the same question (0)
  • Verified answer
    ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard