cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

Associate multiple flows in one app

Hi,

 

I have an app which is associated to only one flow. Now I want the user to select from a dropdown on my app which flow he will run then click a button "confirm" to execute the which flow is selected. How can i achieve this? And what approach is the best for this requirement?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User III
Dual Super User III

Re: Associate multiple flows in one app

Yes, it is possible.  Here's the procedure:

  1. Add one button for each Flow you want to add.  Use that Button to associate the Flow with the PowerApp.
  2. Hide all those buttons
  3. Add a dropdown control and put the names of the Flows in the dropdown
  4. Add another button. Put an If or Switch statement in the ONSelect for that button based on the value in the dropdown. put the run command for the appropriate flow in the True of the IF or the match result of the switch.


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

View solution in original post

8 REPLIES 8
Highlighted
Continued Contributor
Continued Contributor

Re: Associate multiple flows in one app

Well, you can add multiple Flow of course (e.g. Action | Flows) to your app easily.  However, I'd probably ask you if you're really wanting to run multiple flows or just a single flow w/ different parameters?  Regardless, you should be able to do a Switch() statement on which item you've selected from the control and then when you press your button run the appropriate Flow.

Something similar to:

Switch(Dropdown1.SelectedText="1",'myFlow1'.Run(),Dropdown1.SelectedText="2",'myFlow2'.Run())
Highlighted
Dual Super User III
Dual Super User III

Re: Associate multiple flows in one app

Yes, it is possible.  Here's the procedure:

  1. Add one button for each Flow you want to add.  Use that Button to associate the Flow with the PowerApp.
  2. Hide all those buttons
  3. Add a dropdown control and put the names of the Flows in the dropdown
  4. Add another button. Put an If or Switch statement in the ONSelect for that button based on the value in the dropdown. put the run command for the appropriate flow in the True of the IF or the match result of the switch.


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

View solution in original post

Highlighted
Resolver I
Resolver I

Re: Associate multiple flows in one app

Thanks @Pstork1 - this works perfectly on my app


@Pstork1 wrote:

Yes, it is possible.  Here's the procedure:

  1. Add one button for each Flow you want to add.  Use that Button to associate the Flow with the PowerApp.
  2. Hide all those buttons
  3. Add a dropdown control and put the names of the Flows in the dropdown
  4. Add another button. Put an If or Switch statement in the ONSelect for that button based on the value in the dropdown. put the run command for the appropriate flow in the True of the IF or the match result of the switch.

 

Highlighted
Resolver I
Resolver I

Re: Associate multiple flows in one app

This doesn't exactly make sense.  It still seems like you need to be able to call both (or either) flow from a single OnSelect action which I can't seem to be able to insert.  My requirement is a little different in that I need to execute two separate flows sequentially from a single button push.

Highlighted
Frequent Visitor

Re: Associate multiple flows in one app

You can add the individual Power Automate calls on distinct buttons.  At the end of the first button's code, you do a Select(button2Name).  In the OnSelect for Button2, you run the 2nd Flow.  The issue is that these are not reliant upon the the other completing.  Each is submitted into the Queue and Microsoft runs them as resources are available.  To my knowledge, it is "possible" that the 2nd could run before the 1st completes.  If you're dependent upon completion, then you'll need to consider a different method.  Like calling it from the first Power Automate Flow, or writing back to SharePoint from the 1st and having the 2nd trigger on that, etc.

Highlighted
Resolver I
Resolver I

Re: Associate multiple flows in one app

I figured out the Select trick and appreciate the insight on how it executes. Look at the Solution that was posted. It turns out you can run two or more flows from a single PowerApps button you just can’t do it using the Actions—>PowerAutomate button (which is a bit of an editing and usage mess, to say the least). You have to type the flows in directly once they have both been connected to the app. And if you want them to run concurrently, you put them in a Concurrent() function. It was worked nicely. 

And for me, unlike seemingly everyone on this Community, we are not using SharePoint at all in this application. Even if we were (we might need to use it for some file storage in the future) we won’t be mixing up programmatic execution between PowerApps/Automate and Sharepoint. That seems like a recipe for DevOps disaster. 

Highlighted
Frequent Visitor

Re: Associate multiple flows in one app

Actually, I've been building out the architecture for us using SharePoint merely as the storage medium for raw JSON data structures, then having back-end processes move the data where we need it to reside more long-term.  Additionally to automatically build out SharePoint structures (if needed), but the intention is only for short-term semi-structured (i.e. JSON vs. SharePoint fields) storage within SharePoint (including item-level security enabled) for most use-cases.  Only for exceptions would we run a PowerAutomate script to unpack the JSON and auto-create the columns in SharePoint to create the structure inline.

 

It lets us structure things better within DevOps and fit the low/no code model better for most end-user-facing applications (without paying for HTTPS calls or the CDS).  I'd really just prefer to have it all structured around HTTPS service calls, but... 

Highlighted
Resolver I
Resolver I

Re: Associate multiple flows in one app

Nice. We have already committed to CDS so I am focused there for this customer. 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,537)