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 File Properties fr...
Power Automate
Answered

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? 

Categories:
I have the same question (0)
  • Verified answer
    v-xida-msft Profile Picture
    on at

    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

  • Community Power Platform Member Profile Picture
    on at

    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

  • Community Power Platform Member Profile Picture
    on at

    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

    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.

  • TschoofBAH Profile Picture
    154 on at

    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??

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