---
schema_version: "1"
id: 51dbdce96d17c7b4f4a29bc13270c500b00b749c7405a51700b35c2cff3d917f
title: Flow Formula Considerations
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/flow_considerations_design_formulas.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.flow_considerations_design_formulas.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 44b721b0505a862ad8bbd643260b28a831138207425a921ea3c5219dcda6decd
description: When you create a formula resource or add validation to a screen input component, understand the behavior of formulas in flows.
products:
  - Flow Builder
  - Salesforce Platform
release: "264"
---
# Flow Formula Considerations

When you create a formula resource or add validation to a screen input component, understand the behavior of formulas in flows.

## Formula Functions

- These functions aren’t supported in a flow formula.
    
    - GETRECORDIDS
    - IMAGE
    - INCLUDES
    - PARENTGROUPVAL
    - PREVGROUPVAL
    - PRIORVALUE
    - REQUIRE SCRIPT
    - VLOOKUP
    
    For a complete list of operators and functions for building formulas in Salesforce, see [Formula Operators and Functions by Context](https://help.salesforce.com/s/articleView?id=platform.customize_functions.htm&language=en_US).
- In a flow, the `CONTAINS` function checks all characters within its parentheses. For cross object field references, `CONTAINS` works like it does in the rest of Salesforce. It checks only the first 250 characters in the reference.
    
    Here’s an example. `varContract` refers to a record variable that contains the values of a contract record. This formula expression checks only the first 250 characters.
    
    ```
    CONTAINS({!varContract.Account.Description}, "description")
    ```
    
    This formula expression checks all characters in the field.
    
    ```
    CONTAINS({!varContract.Description}, "description")
    ```

## Flow Data in Formulas

- References to global variables in formulas aren’t validated.
- To reference a platform event in a formula, pass the event data into a record variable in the Wait element. Then reference the appropriate field in that record variable.
- To evaluate a `null` field value as a zero value, use the BLANKVALUE function. For example, to evaluate a `null` value for the NumberOfEmployees field as a zero value, use BLANKVALUE(NumberOfEmployees, 0).

## Formulas that Reference a Resource on the Same Screen

- If a formula is used to validate user input and it references a resource on the same screen element as the formula, some formula functions aren't supported. For example, REGEX. For a list of supported formula functions, see [Reactive Screen Flow Formula Operators](https://help.salesforce.com/s/articleView?id=platform.flow_build_reactive_screen_flow_formula_operators.htm&release=264.0.0&type=5 "A subset of the formula operators supported in screen flows support reactivity.").
- If a formula references a resource on the same screen element as the formula, it will honor the percentage. For example, if the value is 100, it is evaluated to 1.00. Otherwise, it doesn’t honor the percentage. For example, if the value is 100, it’s evaluated as 100.

## Gotchas

- A flow formula can contain up to 3,900 characters.
- When you paste a formula, make sure that the apostrophes and quotation marks are straight ('') and not curly (‘’). Otherwise, you get a syntax error when you save the flow.
- Record formula fields are evaluated in flows exactly as they’re evaluated in Salesforce Classic. When a record formula field checks NOT(null/blank), it evaluates to FALSE.

## Errors

A formula returns `null` if an error occurs when the expression is evaluated, such as:

- The value that the formula returns doesn’t match its data type.
- The formula contains an unsupported function.
    
    For example, if your formula resource has a data type of Number, the output must be numeric.

If a flow contains an invalid formula resource, you can’t activate the flow. If a Display Text screen component contains an invalid formula resource, the flow displays an empty string at run time.

#### See Also

- [Formula Resource](https://help.salesforce.com/s/articleView?id=platform.flow_ref_resources_formula.htm&release=264.0.0&type=5 "Calculate a value when the formula is used in the flow.")
- [Flow Resources](https://help.salesforce.com/s/articleView?id=platform.flow_ref_resources.htm&release=264.0.0&type=5 "Each resource represents a value that you can reference throughout the flow.")
- [Creating Flow Formulas with Flow Formula Builder](https://help.salesforce.com/s/articleView?id=platform.flow_formula_builder.htm&release=264.0.0&type=5 "You can use Flow Formula Builder to build an expression in Formula-type resources or in the Collection Filter or Start elements of a record-triggered flow. To build your expression, select from a list of functions and operators. To catch errors as you work, check the formula syntax for each expression.")