You are here:
Send Variable Values to a Flow Using the Flow's URL
When you distribute a flow by using a URL, you can set variables values within that flow by using parameters in the URL.
Required Editions
| View supported editions. |
| User Permissions Needed | |
|---|---|
| To view a flow’s detail page: | View Setup and Configuration |
| To create and edit custom buttons, links, and Web tabs: | Customize Application |
Before you begin, make sure the flow variables that you’re setting are available for input.
- From Setup, enter Flows in the Quick Find box, and then select Flows.
-
Click
for the flow that you want to customize, and select View Details and
Versions.
-
Copy the URL for the flow and add
/lightningto the beginning of the URL.
Note We recommend using Lightning experience and adding /lightning to the beginning of your flow URL. However, if you don't add /lightning to the flow URL, it still works, you just don't get the new benefits of running in Lightning. To learn more, see Choosing Between Lightning and Non-Lightning Flow URL Formats. -
To set a single variable value, append
?flow__name=valueto the end of the flow URL, where name is the unique name of the variable or collection variable in the flow that you want to set and value is the value you want to set it to. -
To set multiple variable values, append
?flow__name1=value1&flow__name2=value2to the end of the flow URL. - To send a list of IDs from a list view to a flow, create a collection variable named ids and make it available for input. It automatically works without setting values in the URL. Learn more in Run a Flow from a Custom List View Button.
-
To set the values for multiple items in the same collection variable that isn't
ids, don't append
flow__before variable names and don't add/lightningto the beginning of the flow URL. Instead, append?name=value1&name=value2to the end of the flow URL.
Setting values for record variables and record collection variables by using URL parameters isn't supported in Lightning or the non-Lightning URL format.
Here are the valid values for each flow variable and collection variable based on its data type.
| Variable Type | Acceptable Values |
|---|---|
| Boolean |
|
| Currency | Merge field of type Number or a numeric value |
| Date | Merge field of type Date or YYYY-MM-DD |
| DateTime | Merge field of type Date/Time or YYYY-MM-DDThh:mm:ssZ |
| Multi-Select Picklist | Merge field of any type or a string in this format: value1;
value2 |
| Number | Merge field of type Number or a numeric value |
| Picklist | Merge field of any type or a string |
| Text | Merge field of any type or a string |
| Time | Merge field of type Time or hh:mm:ss.msZ |
Example 1: Single Variable Value. A flow URL that is used in a custom button on a case page layout. When a user clicks that button, the flow launches with the varID variable (of type Text) set to the case record’s CaseNumber field value.
/lightning/flow/Case_Management?flow__varID={!Case.CaseNumber}Example 2: Multiple Variable Values. Set the varUserFirst and varUserLast variables (both of type Text) to the running user’s FirstName and LastName field values.
/lightning/flow/User_Info?flow__varUserFirst={!$User.FirstName}&flow__varUserLast={!$User.LastName}Example 3: Collection Values. A flow URL is used in a custom button on a contact page layout. When a user clicks that button, the flow launches and adds text values from the contact as items in the {!collNames} text collection variable.
/flow/Contact_Info?collNames={!Contact.FirstName}&collNames={!Contact.LastName}
