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 CaseExplanation
Create a button to trigger the flow on a specific recordIf 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 CaseExplanation
Reference the variable in another flowIn 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 componentYou can also reference this variable using Apex method. More details can be found at the developer forum.
Reference link: https://help.salesforce.com/articleView?id=flow_ref_resources_variable.htm&type=5
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!

Check Out How Input Can Be Used In Real Cases!
Use Case: Simple Loop Example in Flow
Earlier we have published the how-to-guides on Loop and Counter, ...
Read More
Use Case: Simple Counter Example in Flow
Earlier we have published the how-to guides on Loop and ...
Read More
Use Case: Mass Update Records From Related List #2
In this article we introduced the magical ids variable to ...
Read More
Use Case: Mass Update Records From Related List #1
Have you heard of inline editing? This is my favorite ...
Read More
Use Case: Clone Assets To Opportunity Products
I received this case to auto-create Opportunity Product or Quote ...
Read More
Use Case: Add Clone Button To Each Record In A Related List
If you migrated from Classic to Lightning, you must have ...
Read More
Check Out How Output Can Be Used In Real Cases!
No posts found.

Official Salesforce Help Article On Variable

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments