Skip to main content

Notifications

Power Automate - General Discussion
Answered

Start an approval from a selected file from a document library

(0) ShareShare
ReportReport
Posted on by
I am new to Flow, I see a lot of tutorial of approval using Lists.

My question is, how can I start a approval workflow from a sharepoint document library from a selected file?

In my sharepoint document library, i have a lot of folders, each folder has a pdf named “<employeename>_Summary.pdf”

If i upload that certain file in a folder, it should start an approval. How can I do that in a document library?
  • yashag2255 Profile Picture
    yashag2255 24,442 on at
    Re: Start an approval from a selected file from a document library

    Hi @Anonymous , Glad that it worked for you. Please feel free to post any concerns/ help you need in flows on the forum. 

     

    Thanks, 

  • Re: Start an approval from a selected file from a document library

    Hi @yashag2255 finally solved! Thanks for being patient.

     

    I have another concern with the same flow but different issue - its on the approval flow. Will try to look for answers on the forum or will post a new thread. Thanks!

  • Verified answer
    yashag2255 Profile Picture
    yashag2255 24,442 on at
    Re: Start an approval from a selected file from a document library

    @Anonymous , 

     

    You could also just skip the variable part (I put the variable to check the file names coming through)

     

    Please refer to the screenshot below:

    kjhkjhkj.png

     

    Thanks, 

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Re: Start an approval from a selected file from a document library

    @yashag2255 I'm sorry I did not get your advise. I'm new to Flow and this is my first Flow project. Apologies.

  • yashag2255 Profile Picture
    yashag2255 24,442 on at
    Re: Start an approval from a selected file from a document library

    Hi, 

     

    You cannot initialise a variable inside a loop. So you initialise the variable outside with null value. Inside the loop, create an action Set variable/ Append to Array variable and then set the value over there. 

     

     

    Hope this Helps 

     

    Thanks. 

  • Re: Start an approval from a selected file from a document library

    @yashag2255 

    I'm getting this error:

     

    The variable action 'Initialize_variable' of type 'InitializeVariable' cannot be nested in an action of type 'Apply_to_each'

     

    here's the full screenshot of my flow.

     

  • yashag2255 Profile Picture
    yashag2255 24,442 on at
    Re: Start an approval from a selected file from a document library

    Hey!

     

    Using that connector, you should initialise a variable to point to the filename and if that meets te requirement, then start an approval. Please have a look at the screenshot below. 

     

     

    flows.png

     

     

    Thanks, 

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • Re: Start an approval from a selected file from a document library
    Thanks I found it!

    So how can I add to the flow, if the file name contains “Summary”? Whenever I upload a file with file name <employeename>_Summary.pdf it should start the approval.
  • Pstork1 Profile Picture
    Pstork1 64,942 on at
    Re: Start an approval from a selected file from a document library

    There is a trigger in Flow for "When a file is created in a folder".  Use that as your trigger and you can then add an approval action to the flow.  This will start an approval flow every time a file is uploaded to that folder. There are other triggers that you can use if you want to have the approval start whenever a file is uploaded to the library in general also.

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,636

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,942

Leaderboard