cancel
Showing results for 
Search instead for 
Did you mean: 

Pass Variables to Flows through Start Flow Action

When using the Start Flow action (https://docs.microsoft.com/en-us/connectors/flowmanagement/#startflow), it would be useful to be able to pass variables to flows that have inputs. 

 

This is similar to another idea (https://powerusers.microsoft.com/t5/Flow-Ideas/Variable-for-pass-from-a-flow-run-to-next-flow-run/id...) but rather than passing variables between runs of the same flow, I am specifically asking for one flow to be able to pass variables to any flow called using the Start Flow action.

Status: New
Comments
New Member

This is already doable - 

 

Option 1:

Store the values created from Flow 1 in a SharePoint list, Excel file, JSON file etc. Then Flow 2 gets the variable from this file. Flow 2 can be triggered by when an item is inserted or updated in SharePoint list, when a file is created, etc.

 

Option 2 (my preferred method):

Flow 2 is triggered with the 'When a HTTP request is received' action in the 'Requests' connector. Variables can be passed in the URL or as JSON values in the body of the request. Flow 1 triggers Flow 2 using the 'HTTP' connector to submit a web request to Flow 2. Using this method, Flow 2 is also able to send a response to Flow 1 - could be as simple as status code 200 indicating everything is ok, or Flow 1 could pass some values back. Another advantage of this is that Flow 2 can be triggered anywhere within Flow 1, not just when it finishes, and Flow 1 will wait for a response from Flow 2.

 

This method can be used to implement a sort of functional programming - if you have something you need to do a lot, like run a certain calculation, one flow can be created to do that, and it can be sent data by many other flows and can return the computed value. Like a function but a bit clunkier.