cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
DorothyBL
Level: Powered On

Start an approval from a selected file from a document library

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?
1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

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

@DorothyBL , 

 

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.

View solution in original post

9 REPLIES 9
Dual Super User
Dual Super User

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.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
DorothyBL
Level: Powered On

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.
Dual Super User
Dual Super User

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!

DorothyBL
Level: Powered On

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.

 

Dual Super User
Dual Super User

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. 

DorothyBL
Level: Powered On

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.

Dual Super User
Dual Super User

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

@DorothyBL , 

 

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.

View solution in original post

DorothyBL
Level: Powered On

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!

Dual Super User
Dual Super User

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

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

 

Thanks, 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 317 members 5,614 guests
Please welcome our newest community members: