cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate IV
Advocate IV

Add an existing Flow to a SharePoint library

If a Flow already exists, it's easy enough to add it to an existing SharePoint library. However I can't find any way to add a Flow I have previously created to an existing library.

 

Can anyone help me out here?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Add an existing Flow to a SharePoint library

Hi @simonjhudson,

 

Do you want to find a specific flow based on a condition and then save it to an existing SharePoint library if it exists?

 

I have made a test on my side and find the specific flow through flow display name, please take a try with the following workaround:

  • Add a proper trigger, here I use Flow Button trigger.
  • Add a "List My Flows" action of Flow management connector, specify environment.
  • Add a "Filter array" action, From set to value output of "List My Flows" action, within Condition box, left input box set to Flow Display Name dynamic content of "List My Flows" action, right input box set to 20180301_case9 (on your side, set the name of your flow that you want to find), within middle drop down, choose is equal to.
  • Add a Condition, click "Edit in advanced mode", type the following formula:

 

@not(empty(body('Filter_array')))

 

  • Within "If/yes" branch of Condition, add a "Apply to each" action, input parameter set to output of "Filter array" action. Within "Apply to each" action, add a "Get Flow" action, specify environment and Flow field set to Flow Name dynamic content of "Filter array" action. Then add a "Create file" action, specify Site Address and Folder Path. File Name field set to following formula:
Flow Display Name dynamic content of "Get Flow" action.json

File Content field set to Flow Definition dynamic content of "Get Flow" action.

 

Image reference:10.JPG

 

11.JPG

 

The flow works successfully as below:12.JPG

 

The file opens well as below:13.JPG

 

Best regards,

Kris

 

 

Community Support Team _ Kris Dai
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

8 REPLIES 8
Highlighted
Community Support
Community Support

Re: Add an existing Flow to a SharePoint library

Hi @simonjhudson,

 

Do you want to find a specific flow based on a condition and then save it to an existing SharePoint library if it exists?

 

I have made a test on my side and find the specific flow through flow display name, please take a try with the following workaround:

  • Add a proper trigger, here I use Flow Button trigger.
  • Add a "List My Flows" action of Flow management connector, specify environment.
  • Add a "Filter array" action, From set to value output of "List My Flows" action, within Condition box, left input box set to Flow Display Name dynamic content of "List My Flows" action, right input box set to 20180301_case9 (on your side, set the name of your flow that you want to find), within middle drop down, choose is equal to.
  • Add a Condition, click "Edit in advanced mode", type the following formula:

 

@not(empty(body('Filter_array')))

 

  • Within "If/yes" branch of Condition, add a "Apply to each" action, input parameter set to output of "Filter array" action. Within "Apply to each" action, add a "Get Flow" action, specify environment and Flow field set to Flow Name dynamic content of "Filter array" action. Then add a "Create file" action, specify Site Address and Folder Path. File Name field set to following formula:
Flow Display Name dynamic content of "Get Flow" action.json

File Content field set to Flow Definition dynamic content of "Get Flow" action.

 

Image reference:10.JPG

 

11.JPG

 

The flow works successfully as below:12.JPG

 

The file opens well as below:13.JPG

 

Best regards,

Kris

 

 

Community Support Team _ Kris Dai
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

Highlighted
Advocate IV
Advocate IV

Re: Add an existing Flow to a SharePoint library

Actually, my need was simpler. I just couldn't find out how to re-use an existing Flow.

It turns out it's simple. Just make a copy of the Flow, edit it and then choose the new library location and name to attach it to tht library (easy, but not documented anywhere!)

 

However your suggestion is really intersting, as it migh tmake it easy to provision Flows to existing sites automatically. I'll try it out and report back.

Many thanks for the response Kris!

Highlighted
Advocate III
Advocate III

Re: Add an existing Flow to a SharePoint library

Just picking up on a comment

 

"

It turns out it's simple. Just make a copy of the Flow, edit it and then choose the new library location and name to attach it to tht library (easy, but not documented anywhere!)

"

 

Is it now documented and if so where?

Highlighted
Frequent Visitor

Re: Add an existing Flow to a SharePoint library

Ca you provide more details on the solution, please? Copied it? How?

Highlighted
Advocate IV
Advocate IV

Re: Add an existing Flow to a SharePoint library

It really is as simple as creating a copy of a flow, then edit the step in the flow that cake the SharePoint library or list to connect to a different library or list.
Highlighted
Frequent Visitor

Re: Add an existing Flow to a SharePoint library

Thank you for the answer and I have done that. Perhaps I misundersttod the idea. You are not adding the Flow to the library but simply referencing the library in the step (i.e. Get Files) of the Flow. Is this what you were implying?

Highlighted
Advocate IV
Advocate IV

Re: Add an existing Flow to a SharePoint library

Exactly.
You tell the flow to use the library, not the other way around. It was driving me nuts until I spotted how to do that!
Highlighted
Frequent Visitor

Re: Add an existing Flow to a SharePoint library

I felt the same way. Now I know...

Thank you.

Helpful resources

Announcements
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Users online (6,784)