Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

how to capture file name from document library file upload using standard approval Flow

(0) ShareShare
ReportReport
Posted on by

Hi, I'm new to Flow and would love a bit of advice as I can't find a template for this.

 

We have a document library called Reporting (created a flow and found this library for my criteria) and a metadata field to say "Yes" or "No" to whether that file has been processed. 

 

What would be great is an email every two days listing documents in that library where Processed = No.

 

I've got a flow set for every 2 days, with Processed_x003f_ eq "No" but it doesn't seem to be working or if it is I can't see the results.

 

Then the next step is getting it to email those results to me, either in the email body or an attached file.

 

I would've thought this to be a fairly simple win but I'm struggling. Can anyone help?

  • v-xida-msft Profile Picture
    on at
    Re: how to capture file name from document library file upload using standard approval Flow

    Hi @Anonymous,

     

    Could you please share a screenshot of your flow's configuration?

    Further, could you please show a bit more about the metadata field in your SharePoint library?

     

    I have created a SharePoint library (Reporting) on my side and the data structure of it as below:7.JPGNote: The Processed? column is a Yes/No type column in my SharePoint library.

     

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

    • Add a "Recurrence" trigger, Interval set to 2 and Frequency set to Day.
    • Add a "Get files (properties only)" action, specify Site Address and Library Name.
    • Add a "Filter array" action, From set to output of "Get files (properties only)" action, click "Edit in advanced mode", type the following formula:
    @equals(item()?['Processed_x003f_'], false)
    • Add a Variables-> "Initialize variable" action, Name set to AttachmentArray, Type set to array and Value set to empty.
    • Add a "Apply to each" action, input parameter set to output of "Filter array" action.
    • Within "Apply to each" action, add a "Get file metadata" action, specify Site Address and File Identifier field set to following formula:
    item()?['{Identifier}']

           Add a "Get file content" action, specify Site Address and File Identifier field set to following formula:

    item()?['{Identifier}']

         Add a "Append to array variable" action, Name choose AttachmentArray and Value set to following formula:8.JPG

    Note: Within Value field, type a json data which has two elements. The key of first element set to Name and corresponding value set to DisplayName dynamic content of "Get file metadata" action. The key of second element set to ContentBytes and corresponding value set to following formula:

    body('Get_file_content')?['$content']
    • Under "Apply to each" action, add a "Send an email" action, Attachments field set to AttachmentArray variable.

     

    Image reference:9.JPG

     

    10.JPG

     

    11.JPG

     

    The flow works successfully as below:12.JPG

     

    13.JPG

     

    Best regards,

    Kris

     

  • PieterVeenstra Profile Picture
    2 on at
    Re: how to capture file name from document library file upload using standard approval Flow

    Hi @Anonymous,

     

    You are looking for a flow with a trigger that is scheduled every 2 days ( I think that you got this sorted already)

     

    Then an action SharePoint - Get files (properties only)

     

    You could stick a filter in the above action to filter the Yes/No.

     

    Then you have an array which you you run with an Apply To Each

     

    Now Set a variable and expand it wihtin the Apply to each with some value that you want to put in your email.

     

    Then aftyer the Apply To each send out the email and use the variable content to spit out the html that you want to send by email using the dynamic content of the variable.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,618 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,962 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow