Build if/else control flow in an action sequence (Beta)
This documentation describes a public beta feature and is under construction. This page should not be considered part of our published documentation until this notice, and the corresponding Beta flag on the feature in the Sigma service, are removed. As with any beta feature, the feature discussed below is subject to quick, iterative changes. The latest experience in the Sigma service might differ from the contents of this document.Beta features are subject to the Beta features disclaimer.
Use an if/else statement to create a dynamic workflow within an action sequence. If/else control flow adds flexibility to a sequence by allowing it to check one or more conditions and execute actions for the first condition that evaluates to true.
This document introduces the if/else framework, provides tips and best practices, and explains how to configure an if/else statement in an action sequence. You can also try an interactive demo in the Examples section of this document.
User requirements
The following requirements apply to users who configure actions. Users who access and interact with a workbook can typically trigger all existing actions within it. Any restrictions are noted in this document.
The ability to configure actions requires the following:
-
You must be assigned an account type with the Full explore or Create, edit, and publish workbooks permission enabled.
-
You must be the workbook owner or be granted Can explore1 or Can edit access to the workbook.
1If you’re granted Can explore access to the workbook, you can configure actions in custom, saved, and shared views. Actions saved to views do not apply to the workbook’s published version.
About if/else control flow
If/else is a type of conditional statement that allows you to add logical control flow within an action sequence. You can insert an if/else statement anywhere in the sequence to add a decision point where an action or group of actions only executes if a specific condition is true.
Action paths
Without if/else control flow, a sequence executes actions on a linear path: every action runs, and they run in the same order each time.
When you add if/else logic, a sequence can diverge from the linear path and execute different actions depending on whether a condition is true or false. You can configure one or more conditions in an if/else statement (see Components of an if/else statement), and the sequence checks them sequentially until one evaluates to true or the statement ends. When a condition is true, the sequence executes the corresponding actions, then returns to the linear path of the sequence.
Components of an if/else statement
In an action sequence, an if/else statement can include the following components that determine which action path executes:
if | The primary path that executes if its condition is true. An if/else statement always includes the if component. |
else if | [Optional] One or more alternative paths that are only checked when the if condition and previous else if conditions (if any) are false. Else if conditions are checked sequentially, and when a condition evaluates to true, the sequence executes that path and ends the if/else control flow. |
else | [Optional] The default path that executes when the if condition and all else if conditions are false. |
If the if/else statement doesn't include an else component, no action path executes when the if condition and all else if conditions are false.

Tips and best practices
The following information can help you build a robust and reliable if/else control flow.
-
Use if/else statements to simplify action workflows by consolidating multiple conditions into a single sequence. This also ensures consistent order of execution, which is not guaranteed when creating conditional workflows in separate sequences. For a comparison of a use case with and without if/else, see Example 1 in this document.
-
A sequence checks the conditions of an if/else statement sequentially and stops when one evaluates to true or the statement ends. Therefore, it's important to consider the following:
-
The order of the conditions matters. Multiple conditions may be true, but only the first one evaluated is executed.
-
If there are conditions that the sequence must continue to check, configure them in a separate if/else statement within the sequence.
-
-
Including the else component to define default output can prevent workflow errors and incomplete logic.
-
If/else conditions can reference the results of previous actions in the sequence. You can use this functionality to check for specific action variable values, including the output of a called stored procedure (see Example 2 in this document).
-
Drag and drop if and else if components to quickly reorder them within an if/else statement. You can also drag and drop individual actions to reorder them within a component, move them between components, or move them into or out of the if/else statement.
Build an if/else control flow
The following sections explain how to build an if/else control flow with a sequence.
- Add an if/else statement
- Configure the if component
- Configure else if components
- Configure the else component
Add an if/else statement
Add an if/else statement to an action sequence.
-
Open the draft, custom view, or saved view of a workbook.
-
Select the trigger element (the element users must interact with to initiate the if/else control flow).
-
In the editor panel, open the Actions tab.
-
Create a new sequence, or locate an existing one that you want to modify.
-
Click
Add action to add a new action to the sequence.
-
The action configuration modal opens automatically (if it closes, select the action name to reopen it). Click the Action field and select If/else.
-
In the sequence, Sigma converts the action to an if component and opens the Condition modal. To continue building the if/else control flow, see Configure the if component in this document.
Configure the if component
Define the if condition and configure one or more actions that execute when the condition is true. The sequence always checks the if condition and only proceeds to check else if and else conditions when the if condition is false.
-
Define the if condition:
-
Select the if component to open the Condition popover.
-
In the Condition popover, select one of the following condition options from the dropdown (available options depend on the element type), then define the criteria that must be met for the corresponding action to run.
-
- Custom formula: Enter a formula that must return
true
. - Selection matches criteria: Select a column and specify the required column value.
- Selected values contain: (available with multi-select List values controls only) Specify a single value that must be one of the selected control values.
- Control value is equal to: Specify the required control value.
- Custom formula: Enter a formula that must return
-
-
Configure the primary path to execute when the if condition is true:
-
Select the default action in the if component, or click
More next to the condition and select Add action within to add a new one.
-
In the action configuration popover, select an action type and configure the effect. For a list of action types and detailed information about how to configure them, see Action effects.
-
[Optional] Repeat steps 2a and 2b above to add more actions to the component.
-
Configure else if components
[Optional] Define an else if condition and configure one or more actions that execute when the condition is true. Repeat the steps to add multiple else if components.
-
To add an else if component, click
More next to the if condition or any previously added else if condition, then select Add else if.
-
Define the else if condition:
-
Select the else if component to open the Condition popover.
-
In the Condition popover, select one of the following condition options from the dropdown (available options depend on the element type), then define the criteria that must be met for the corresponding action to run.
-
Custom formula: Enter a formula that must return
true
. -
Selection matches criteria: Select a column and specify the required column value.
-
Selected values contain: (available with multi-select List values controls only) Specify a single value that must be one of the selected control values.
-
Control value is equal to: Specify the required control value.
-
-
-
Configure an alternative path to execute when the else if condition is true:
-
Select the default action in the else if component, or click
More next to the condition and select Add action within to add a new one.
-
In the action configuration popover, select an action type and configure the effect. For a list of action types and detailed information about how to configure them, see Action effects.
-
[Optional] Repeat steps 3a and 3b above to add more actions to the component.
-
Configure the else component
[Optional] Configure one or more actions that execute when the if condition and all else if conditions are false.
-
To add an else component, click
More next to the if condition or any else if condition, then select Add else.
-
Configure the default path to execute when the if condition and all else if conditions are false:
-
Select the default action in the else component, or click
More in the else heading and select Add action within to add a new one.
-
In the action configuration popover, select an action type and configure the effect. For a list of action types and detailed information about how to configure them, see Action effects.
-
[Optional] Repeat steps 2a and 2b above to add more actions to the component.
-
Example 1: With and without if/else
The screenshots in the Build an if/else control flow sections of this document demonstrate a use case in which an if/else statement is used to streamline a workflow that could also be configured using three separate conditional sequences. The two methods support the same interactivity (see the interactive demo below), but the if/else statement represents the workflow with more clarity and can be easier to maintain and debug.
With if/else | Without if/else (conditional sequences) |
---|---|
![]() | ![]() |
Interactive demo
The following embedded example demonstrates the use case configured in Example 1. When you select a value in the Filter by last segmented control, the action sequence sets the Period data range control based on the selected value (using if/else control flow), which then filters the table data.
Example 2: Check called stored procedure output
This example demonstrates how an action sequence can call a stored procedure and then use an if/else control flow to apply different logic using the value returned by the called stored procedure.
The following action sequence is configured on a data app that allows users to check current product stock and request a restock. When the sequence is initiated, it first calls the PROCESS_DATA
stored procedure that returns a number. The if/else control flow then references the called stored procedure output when checking the if and else if conditions and when executing the else action path.

Updated about 1 hour ago