Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Get File Properties from File Name

(0) ShareShare
ReportReport
Posted on by

Hi all, I am trying to achieve something in Flow that was so simple in SharePoint Designer.

I have created a workflow on Library1, and I need it to check Library2 for any file with the Name of the document in Library1, and get that file's properties. Specifically I want the file URL.

In SP Designer I would just create a workflow variable from Library2 using field "Name" and I could choose whatever file property I wanted. enter image description here

But with Flow the Get File Properties seems to throw tons of errors and basically crashes the workflow. It also doesn't allow me to select just one property, but instead proceeds to 'get' all the properties. enter image description here

My desired result is:

When a file is created in Library1, check if a file with the same name exists in Library2. If it exists, get file in Library2's URL and send it in an email.

Can anyone show me an easier way to achieve what I am trying to do? 

  • TschoofBAH Profile Picture
    154 on at
    Re: Get File Properties from File Name

    Great solution to a similar problem I was having, so thanks for that! 

     

    I must ask, is there a good reason why we must jump through 3 hoops to gather information that really should just be provided in the first place? Why is it that we have to use three different steps to retrieve the link??

  • Community Power Platform Member Profile Picture
    on at
    Re: Get File Properties from File Name

    Sylvie,

     Without knowing for sure, I would guess that it is taking a long time because of the large number of files the 'Get files (properties only) query in the Flow. Expanding the advanced options in there it suggests filter query options, limit the number of columns returned by a view and the top number of rows to return from the query. Those are quite probably for the very reason you're suggesting I'd imagine.

  • Community Power Platform Member Profile Picture
    on at
    Re: Get File Properties from File Name

    Hey Kris, 

     

    I've noticed in some cases the Apply to Each function is taking a LONG time to complete. For example...it's still running from 3 days ago. Is that simply because it's a heavy command? Will this type of performance get worse as the number of files increases?

     

    Thanks,

    Sylvie

  • Community Power Platform Member Profile Picture
    on at
    Re: Get File Properties from File Name

    Fantastic, thank you so much for this extremely clear step-by-step guide Kris. 

    I've created it and indeed it is sending me the links to documents. 

    I'm going to see if I can adapt this to:

    1. Run on a button

    2. send an approval email

    3. on approval, add the link into a column in Library1

    3. add a date in another column in Library1. 

     

    Thanks again, this was SO helpful!

     

    Sylvie

  • Verified answer
    v-xida-msft Profile Picture
    on at
    Re: Get File Properties from File Name

    Hi @Anonymous,

     

    I have made a test on my side and please take a try with the following workaround:

    • Add a "When a file is created (properties only)" trigger, Library Name set to MyLibrary1.
    • Add a "Get file metadata" action, File identifier field set to Identifier dynamic content of the trigger.
    • Add a "Get files (properties only)" action, specify Site Address, Library Name set to MyLibrary2.
    • Add a "Apply to each", input parameter set to output of "Get files (properties only)" action.
    • Within "Apply to each", add a "Get file metadata 2" action, File identifier field set to Identifier dynamic content of "Get files (properties only)" action.

             Add a Condition, click "Edit in advanced mode", type the following formula:

    @equals(body('Get_file_metadata_2')?['DisplayName'], body('Get_file_metadata')?['DisplayName'])

    Within "If/yes" branch of Condition, add a "Send an email" action, Body field set to Link to item dynamic content of "Get files (properties only)" action.

     

    Image reference:24.JPG

     

    25.JPG

     

     

    The flow works successfully as below:26.JPG

     

     

    Best regards,

    Kris

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492