Expression Set Actions
The configured function of an expression set can be a simple decision matrix lookup, a calculation based on a mathematical formula, a condition, or another expression set.
When a Flow is invoked using Batch management (for example, for processing 200 records), the calls to expression sets are automatically bulkified, which allows the execution of multiple inputs in a single request.
These actions are available in API version 55.0 and later.
Supported REST HTTP Methods
- URI
- /services/data/v55.0/actions/custom/runExpressionSet/{ApiName}
- Formats
- JSON
- HTTP Methods
- POST
- Authentication
- Authorization: Bearer token
Inputs
Inputs vary depending on the selected expression set. For expression sets tied to a context definition, you can build and persist context data using additional inputs.
| Input | Details |
|---|---|
| __<ContextNode>RecordIds |
|
| __mappingName |
|
| __persistContextData |
|
| __buildContext |
|
For context-based expression sets, provide either the context ID or the build context parameters. If both are provided and __buildContext is true, the context ID is ignored and the context is built from the input record IDs.
Outputs
Vary depending on the inputs of the selected expression set.
Usage
- When the expression set is not linked with a context
-
This section has the sample request and response for invoking an expression set with these steps.
- Find the tax percentage and the premium corresponding to specific age and salary using a decision matrix lookup.
- Check the age criterion to calculate the total tax.
- Calculate the total tax to be paid based on the age group, salary, and the tax percentage.
- Sample request
-
Here’s an example POST request that has the inputs, such as, age and salary.
- Sample response
-
Here’s an example response that has the premium and tax values based on the inputs provided in the example request.
- When the expression set is linked with a context
-
An expression set can be configured with a context definition. In this case, the expression set runs using context data that is either provided directly or built at runtime.
- Sample request when context ID is available
-
Here's an example request that runs a context-based expression set using an existing context ID.
- Sample response
-
Here's an example response for a context-based expression set execution.
- Sample request when context ID is not available
-
When an expression set is tied to a context definition and a context ID isn't available, use the __buildContext parameter to build the context before the expression set runs. You can also persist the context data to the database after execution by setting __persistContextData to true.
Here's an example POST request that builds the context, runs the expression set, and persists the context data.
- Sample response
-
Here's an example response that includes the context ID that was built during execution.