Flow: How To Use Availability Outside The Flow (Input/Output)
I was very confused when I first learned about these options. (If you are also not a developer, I am sure you can feel the same way). Input and Output sound like this in my mind:
– Input: A value can be written into a variable. (ex. Assign NewName = Melody, so Melody is the input)
– Output: A variable can pass the value to another place. (ex. Contact Name = NewName, so NewName is the output)
Based on this logic, we can already achieve this through the Assignment element in Flow, so why do we need these checkboxes?
In fact, this confusion can be easily answered by the title of this option – Availability Outside the Flow – so we have to incorporate it into the concepts:
– Input: A value from outside of the flow can be written into a variable.
– Output: A variable can pass the value to another place outside of the flow.
So much clearer isn’t it? Following I will show you how exactly these two options can be used:
1. Available for Input
Before the recordId was introduced, this option is used very often!
Use Case | Explanation |
---|---|
Create a button to trigger the flow on a specific record | If you want the flow to run on a specific record, you need to pass the ID of that record into the flow. As the ID is stored outside of the flow, you need to first create an input-available variable, and assign the value in the flow URL. You can achieve the same by using recordId and action – See here! |
Create a variable and allow for input: | After activating the flow, create a detail page button, paste in the flow URL, and append “?[API name of the input variable] = {!Object.Id}” |
Trigger the flow on a specific record from a process in Process Builder | It is the same idea but with an easier interface. When you choose a flow as the action, the Set Flow Variables will pop up automatically. If you have input-allow variables, you will be able to choose them here and assign values. |
2. Available for Output
Use Case | Explanation |
---|---|
Reference the variable in another flow | In order to use the output variable, the flow with this output variable must be a subflow of another flow. |
Reference the variable in a Lightning web component | You can also reference this variable using Apex method. More details can be found at the developer forum. |
https://help.salesforce.com/articleView?id=flow_ref_elements_subflow.htm&type=5
I have actually never used “Available for Output” in my Salesforce journey. What is your real use case? Share with me below!