How to create Variables in Salesforce Flow

Variables are essential for storing and managing data in your Salesforce Flows. Whether you choose to create a variable when you need it or in the Toolbox, the process is quite straightforward.

Steps to create a Variable

To create a variable in Salesforce Flow, you can:

1 . Click the New Resource button in the Toolbox on the left of the Flow Builder

2 . Select Variable for Resource Type

Provide the following information:

  • API Name
  • Description
  • Data Type 

3 . Click “Done” to complete the variable creation process.

 

That’s it! You’ve successfully created a container for storing data, and you can easily access it in the Toolbox.

Here are some common use cases for Variable in Flow

  • Storing the ID of the record that the flow is displayed on
  • Storing a number value that can change based on user choices
  • Storing the result of joining two text strings together
  • Retrieving record values to use in calculations, copy to another record, or display to a user