Loading
Salesforce now sends email only from verified domains. Read More
Automate Your Business Processes
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Flow Variable Considerations

          Flow Variable Considerations

          Before you create a variable resource, understand the behavior of variables in flows.

          Required Editions

          View supported editions.

          This video explains what variables are and how flows use them to hold data.

          View this video in a separate tab.

          This video explains variable types including common types, Boolean, Apex-defined, and collection variables.

          View this video in a separate tab.

          Referring to Blank Fields or Resources

          • If you leave a field or resource value blank, the value is null at run time. To treat a text value as an empty string instead of null, set it to {!$GlobalConstant.EmptyString}.

          Boolean Variables

          • Boolean Types Treat null Differently than false
          • A flow treats null as a different value than false. For example, if you try to find a record whose checkbox field is set to null, no records are returned. Instead, look for records where the checkbox field is set to false. If you’re using a variable (such as myCheckbox = {!varBoolean}), make sure that the variable isn’t set to null before you reference it in your record filter or condition.

          Number Variables

          • Number variables are treated as integers by default.

          Percentage Variables

          • If a flow uses record variables to manipulate percentage values, test the flow carefully. When you insert a value into a record variable’s percentage field and then reference that field in a formula, the value is divided by 100.

            For example, an opportunity’s Probability field is set to 100. If you assign that value to the {!Opportunity.Probability} record variable, the value is still 100. But if you create a formula whose expression is {!Opportunity.Probability}, the value is 1.

          Record Variables

          • Record and record collection variables support only Salesforce objects.

          Available for Input/Output

          • Disabling input or output access for an existing variable can break the functionality of applications and pages that call the flow and access the variable. For example, you can access variables from URL parameters, subflows, and processes.
          • You can't add new input or output variables to a flow override. While you can remove existing variables, removing an input variable causes a run-time error if the calling component, such as a Lightning component, tries to use the deleted input variable.

          Setting Input Variables

          • Process Builder: When a process or flow launches another flow, that flow’s input variables can be assigned values during the launch. However, for a text, picklist, or multi-select picklist variable that isn’t a collection, a value of null is converted to an empty string.
            Important
            Important Support and updates for Process Builder are scheduled to end as of December 31, 2025. See Workflow Rules & Process Builder End of Support.

            After December 31, 2025, you can continue to activate, deactivate, and edit any existing processes. To migrate existing processes, plan your switch to Flow Builder and use the Migrate to Flow tool. For new automations, create flows in Flow Builder.

          • Actions: Flow actions let you pass the value of the record's ID field into the flow, but that's it. If your flow has a Text input variable called recordId, the action passes the record's ID into that variable at runtime. If not, it doesn't and the flow tries to run anyway.
          • Lightning App Builder: Collection variables, record variables, and record collection variables aren’t supported. The Flow component supports only manually entered values for input variables. Text input variables accept a maximum length of 4,000 characters.
          • Subflow element: When you pass a variable to a subflow input, the variable API name can be up to 40 characters long.

          Distributing Flows

          • When you distribute a flow, don't pass a currency field value from a Salesforce record into a flow currency variable with a URL parameter. When a currency field is referenced through a merge field (such as {!Account.AnnualRevenue}), the value includes the unit of currency’s symbol (for example, $). Flow currency variables can accept only numeric values, so the flow fails at run time. Instead, pass the record's ID to a text variable with a URL parameter. Then in the flow, use the ID to look up that record’s value for the currency field.
           
          Loading
          Salesforce Help | Article