This blog post is Human-Centered Content: Written by humans for humans.
What are Sigma Actions?
Imagine enabling users to instantly filter a dashboard to just their regional sales, then automatically opening a detailed breakdown page with a single click. Or picture giving analysts the ability to launch a stored procedure that forecasts next quarter’s revenue, or surface AI-driven insights directly inside your analytics platform, without ever switching tools.
This is where Sigma Computing, the cloud-native BI platform comes in. Sigma provides a suite of actions which can be leveraged to automate workflows and empower developers to create sophisticated data apps with ease. For users sigma action sequences streamline complex tasks into smooth, straightforward workflows. Along with input tables (covered in this blog post), actions are one of the key tools Sigma offers which allow developers to construct apps out of their data.
Digging in
There’s a lot to go over here — certainly more than one blog’s worth (we won’t go in depth on cover context menus or plugins here). But here, we will cover what options Sigma provides as well as some general tips and tricks for getting the most out of action sequences.
Action sequences
Action sequences are groups of actions that execute in sequence once triggered. Here’s a quick look at a how to create an action sequence in Sigma.
In order to create or edit actions the user must be in Edit mode.
- Select an element (provided you have the right user permissions) while in production view.
- Navigate to the action pane.
- There will already be an empty action sequence in place. Simply click the “+” in the action sequence to add actions, and begin creating your data app.
You can also add additional action sequences to the same element by clicking on the “+” near the top of the pane next to “ACTION SEQUENCES” like you can see here:
Action sequences execute sequentially. Usually, this means each action fully executes before the next begins. However, in some cases, individual actions may be asynchronous. For example, in the case of an action sequence containing the Trigger plugin action, the subsequent action may not wait for the completion of the trigger plugin action before executing. (If you are interested in learning more about when and why sequential execution may not take place, please take a look at Sigma’s Documentation.)
One of my favorite features of Sigma action sequences is that using menus you can duplicate, copy and paste individual actions or even entire sequences, rename and delete actions. These features are especially handy when stacking conditional action sequences which we will cover later.
Action Sequence Triggers
There are currently a few triggers for actions sequences supported in Sigma. “On selection” meaning when the user selects the element. “Cell context menu” meaning the action is triggered upon the selection of a particular option set up in a cell context menu. The “on change” trigger occurs when a control value changes. For buttons and images, there is “on click” which is similar to “on select” but does not create a selection action variable. There are also a few action variables specific to modals that function effectively the same as “on click.”
Additionally, when the element is a table, another option will appear below “On Select,” allowing the user to designate which columns selection will trigger the action sequence.
Now that you understand how to create action sequences, we will break down what actions are currently available in Sigma and what they do.
Available Actions
We will take a quick glance at all the actions Sigma currently offers at the time of writing and their functions. Generally, actions are straightforward to implement, so I’ll keep explanations brief to focus on how to get the most out of actions at a higher level.
Navigation
These actions are used to navigate the user both in and out of the Sigma environment.
Open Link
Opens a URL in the web browser. You can use dynamic values here to reference a control or column if you want the URL to be dynamic. Additionally, there are options to control whether the URL will open in the same window, a different window or the parent window (for embedding).
Open Sigma Doc
Like Open Link, Open Sigma Doc allows the user to navigate outside of the current workbook, but in this case, the user is navigated to another workbook in the Sigma environment. Additionally, this action has the same window options as Open Link.
Navigate in this workbook
Likely, this is the navigation action which will be used most often. It allows users to navigate between pages of the same workbook, or even within the same page. Developers can decide if the action navigates the user to the top of a page or to a specific element within a page.
Select Tab
This action changes the tab of tabbed container to the next tab, the previous tab or a specific tab. This action is useful especially when you do not want to use the default tab headers.
Download and Export
Exports the workbook, a specific page or a specific element from the workbook. This can be a download, email, Slack, Teams, SharePoint, webhook or cloud storage. Not all integrations are enabled by default. Those which are not enabled by default must be configured by an admin. Exports can be formatted as PDF, PNG, Excel files or .csv, depending on the type of element being exported and the destination of the export. Additionally, for PDFs, you can specify formatting options. For Excel exports, you can choose whether to include metadata.
Controls
These actions allow the user to interact with control elements.
Set Control Value
Sets a specified control to either a column (based on a selection), another control or a custom formula.
Clear Control
Clears the value of a specific control or all controls on a specific page. It is often the best practice to use this action at the end of an action sequence which closes a modal, so all controls on the modal are cleared so they can be refilled the next time it is opened.
Elements
These powerful actions can directly modify elements within the workbook and which variables are used within them.
Modify Element
When choosing this action, the developer is prompted to select a target element, then how to modify the element from the following options:
- Show columns: Select a number of columns to reveal from the element with an option to hide any unselected columns.
- Hide columns: The same but in reverse.
- Move Columns: Assign columns to a particular property of a visualization such as tooltip.
- Swap Columns: Replaces a column in a property of a visualization with a different column.
These actions are especially useful to get around some of Sigma’s visualization limitations such as not being able to stack hidden charts on top of each other. Instead, Sigma empowers the user to completely restructure an element through Element actions.
Refresh Element
Refreshes a particular element including any calculations or data connections.
Modals
These simple actions control modals. Modals are elements which appear on top of an app page in Sigma. Usually, they contain interactive elements such as controls for users to fill out like a form, but they can take many other forms.
Above: The “Request New Flight” Modal appears over the top of the app page.
Open Modal
Opens a specified modal.
Close Modal
Closes the current modal.
Input Tables
These actions allow for the modification of input tables through element interaction and actions. Some input table actions may be limited by user permissions and warehouse configurations. Some input table actions also generate action variables.
Insert Row
This action inserts a row into a particular input table. The input table must be able to be modified vertically (See my guide to input tables in Sigma). Each column can be specified to insert as a static value, control or formula.
Update Row
Update row works similarly to insert row, but the key difference is with the update row action the ID of the row must be specified. Best practice here is to set a control to an ID and then reference that control.
Delete Row
Delete Row works just like update row. However, the only input here is the ID of the row to be deleted.
A note on inserting and deleting rows: If you plan to insert rows or delete a row then use some other Input Table action in the same action sequence, you may run into surprising errors. This is one of the reasons why using controls is good practice.
Advanced
These are the more advanced actions available in Sigma at the moment. All of these require some sort of work outside of Sigma’s environment. They need to be enabled by admins or developed outside of sigma in some way. Additionally, plugins specifically can be set up to be targets or triggers for actions.
Call Stored Procedure
Calls a stored procedure from the data warehouse. The called procedure must return a scalar value meaning a result which can be stored in a single cell. This action also creates an action variable that can be used in formulas in the action sequence. Not every data warehouse provider supports the called stored procedure action. As of writing, only Snowflake, PostgreSQL, BigQuery and Redshift are supported. See Sigma’s documentation on limitations here.
Generate iframe event (for embedding)
This action generates event keys and values named by the developer. The Key value can be set as a particular data type or a formula. These outbound iframe events can then be sent to a plugin which is configured to respond to them in some way. Read the sigma documentation here.
Trigger Plugins
Plugins are elements whose code is hosted outside of the Sigma environment. This action triggers a specific plugin effect. See Sigma documentation here.
Advanced Techniques
Now that we have covered the fundamentals of each action type in Sigma, we will cover some tips and tricks to get the most out of these actions to create a killer data app.
Using Controls
Controls allow developers to easily create dynamic references for calculations. This is especially helpful when dealing with complicated action sequences. Often, best practice, especially when updating and deleting rows via input table actions, is to set a control to the ID of the target row then delete or update based on the control value. This helps to break up complicated actions and calcs to make them both more understandable and executable.
For example, when setting up a flow for updating an approval column: First, create an action which updates a control to the ID column of the table with the approval data. Next, you can fill out a modal with the controls you want your user to interact with, and when you create an action sequence to update the row, you can have it reference the ID you set earlier.
Above: Here we set a control (hidden on another page) to match the ID of the selected row. The rest of the action sequence prefills the modal which will open with information from the selected row.
Above: Now, in the modal we update the row which ID matches that of the control we updated when opening the modal.
This concept applies beyond input tables as well. If you find yourself trying to put too many steps into one action formula or condition, try to think about breaking it up into steps that update a control or two then reference the control values in the final formula.
On the other hand, if the scope of the action would require updating multiple controls simultaneously, you could also use an input table with multiple columns as a helper table instead. This method can help keep the number of elements in the environment from getting out of hand.
Conditional Action Sequences
Conditional Action Sequences are powerful tools for programmatic executions of action sequences. When working with conditional action sequences at times it almost felt like I was working with a tool as flexible as coding in Python (with a notable lack of loops).
Here’s how to create a conditional Action Sequence:
- Choose the element you want to host your actions sequence.
- Navigate to the actions pane.
- On the three dots in the action sequence menu, select “Add condition.”
- Now you have two options:
- Selection matches Criteria OR
- With this you can specify how you want your selection to interact with the condition. One example of this is the “is not null” option. This allows you to trigger the action sequence only if something within the element has been selected (rather than the element itself for example).
- Custom formula
- This is where things get advanced. If you want your condition to reference multiple controls or variables, you will need to use a custom formula.
- Selection matches Criteria OR
Above: Here the action condition is set to ”Selection matches criteria” where the column ”Flightpath” is not null. Now the action sequence which navigates the user to a different page is only triggered when the user clicks on a valid flightpath. Without the condition, the user would be navigated anytime they selected the map element at all making navigating within the map itself virtually impossible.
Stacking Conditions
Whether by using selection matches criteria or a custom formula, action conditions are binary by nature. However, by creating multiple action sequences with different conditions developers can mimic ELSEIF logic to create complex logic in their data apps:
This opens up a plethora of potential uses and makes me long for an implementation of python style loops. However, the current capabilities of the conditional actions are extremely powerful and versatile.
Action Variables
Action variables are just that: Variables created by actions. You may be familiar with action filters in Tableau and these behave somewhat similarly.
There is one native action variable: Selection, but the user can also create new action variables by calling stored procedures from the data warehouse within the action sequence or by using Input Table actions.
Action variables are native to the action sequence which creates them. Therefore, action variables cannot be referenced in an action sequence that did not create the action variable.
The Selection Action variable
Selection variables are extremely useful, not only in conditions, but also in updating controls. When the user triggers an action sequence on selection, a selection action variable is created based on which part of the element was selected. This can then be referenced by actions in that action sequence. For example, if a user selected the first bar in the following bar chart:
Two action variables would be created: One for each variable in the bar chart. The [Route] Selection variable would be filled with “Stillwater to Dallas-FortWorth” and the [Total Passengers] Selection variable would be filled as 90.
The selection variable can be referenced like a column when writing formulas, but can also be referenced directly in some cases. It appears in this format: [Selection/’column name’]. This way you can target multiple columns based on the selected object in the right circumstance:
Above: Note how the action condition ensures that the selection does not pull a null destination point — in this case, this means the action sequence only triggers when the user selects a point on the map, and not just the map in general. Next, a control is updated based on the name of the airport selected a different column.
Row ID Action Variables
Other action variables are created automatically when you update, insert or delete a row. These action variables capture the ID of the effected row. This means you can easily reference the same row multiple times in your action sequence without having to repeat the logic which identified the row in the first place.
Action Variables which are created in an action sequence are exclusive to that action sequence. So, if you update a row in one action sequence, you cannot reference it in another. (But you could have the first action sequence update a control with the row ID which the second action sequence would then reference).
Stored Procedure Action Variable
There is another type of action variable, which is created when the user calls a stored procedure from the data warehouse. Stored Procedure action variables store the results of the stored procedure called in an action sequence.
Calling Stored Procedures
The ability to call stored procedures from the warehouse basically eliminates the limitations of cloud-based spreadsheet formulas in addition to giving businesses the ability to leverage their existing procedures and the insights generated from them.
- Make the procedure and save it in the data warehouse (make sure the permissions are correct)
- The procedure does not necessarily need to be tied to the Sigma writeback database, but if the procedure is only being used in Sigma it could be a good idea to keep it in the writeback database.
- Call stored procedure in action sequence to create action variable.
- Essentially this stores the results of the stored procedure as an action variable which can then be used later in the action sequence.
- Use the action variable named after the stored procedure in an action.
- This is where you connect the result of the stored procedure with what you actually want it to do in the workbook.
Keep in mind that the name of the action variable generated by Sigma is a copy of the stored procedure title. This can get a little confusing if you are calling the same procedure multiple times in the same action sequence. The easy way to determine which action variable is generated by which call stored procedure action is order. The action variables will appear in the order they were created.
Above: Here we generate a random integer to simulate rolling a die by using a stored procedure. In order to simulate the results of two die, I need to call the procedure twice. Notice how this creates two action variables with the same name, but each contains a unique randomly generated result. So, to use both I must be careful of the order I call them and subsequently reference them.
Bringing it Together
With its growing suite of actions and tools, Sigma creates a rounded Data App development experience. The sky is the limit here. The combination of advanced data management integrations, beautiful visualization capabilities and application features Sigma provides for a plethora of use cases.
You can even push the tool far enough to create a functional, interactive D&D character sheet complete with dice rolling “animations.” Please enjoy this playful application of advanced features.
Above: The demonstration video showcases how different action sequences can be combined in order to automate complicated processes like those used in managing a TTRPG character sheet.
It’s hard not to get excited about all the valuable tools Sigma brings to the table. If you are interested in learning more about Sigma or other data, IT and BI tools make sure to reach out and let us know what excites you!