cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
simonjhudson
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
v-xida-msft
Community Support
Community Support

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
v-xida-msft
Community Support
Community Support

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

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!

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?

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

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.

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?

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!

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

Thank you.

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (46,041)