One day, after exploring Sigma’s app builder features for about a month, I had a eureka moment. I came up to my coworker Josias, “I am going to try to make a game in Sigma.” I could not think of a more perfect way to test the tool.
When I found a deck of cards dataset in our company Snowflake Sandbox, I knew I had to try to make a Texas Hold’em simulator. By leveraging Input tables, dynamic text and conditional action sequences, my idea quickly transformed into a functional simulation.
Call Stored Procedure
The first step in any card game is dealing the cards. For our poker simulator, that means randomly generating a set of cards from a 52-card deck without replacement. While Sigma doesn’t have a native function for this, we can leverage the power of a stored procedure from the data warehouse. I wrote a simple SQL procedure to handle the randomization and made sure it had the correct permissions to be accessed from Sigma. Then I used the “Call Stored Procedure” action to simulate dealing all the cards necessary for the game.

It is important to make sure the stored procedure returns as an array so the result can be put into a single cell.
Now that we have an array with randomly generated card IDs (in this case just numbers 1 – 52), we can start building the rest of the game. If you are confused as to how this works or want to learn more about how to use Sigma actions, check out my guide.
Clean the Array
Before we can actually use the information generated from the stored procedure, we need to parse the array and convert it into a tabular format.
![]()
I used a combination of SplitPart (which functions the same as Split in Tableau) and RowNumber to split the string and pivot it automatically. The Replace() functions help cleans up extraneous text from the array.
Leverage Dynamic Text and Image URLS
Based on the cards drawn from the stored procedure and a data table containing information on all 52 cards we can create a table outlining the information on the cards in play.

With our cards now in a usable table format, it’s time to bring the game to life visually. I started by finding some open-source poker card images hosted on public URLs. This was a critical step, as one of Sigma’s coolest features is the ability to integrate dynamic text directly into an image object. This lets you assign a formula to the image itself, allowing it to change dynamically based on the data.

Now we can have a single image element display either the back of a card or a specific card from the deck. This is dynamic based on the player or phase of the game. Now we have the ability to reveal cards based on the current phase of the game and also to “deal” new cards each time we refresh the results from the stored procedure.
All the Controls
As BI practitioners, we usually work with traditional “tall” data tables; but in Sigma, I often find myself gravitating towards using a few “wide” input tables. I use these as dynamic reference tables, similar to how I use controls, but with a little more flexibility. I created a table to track chip counts for each player and the pot using this technique.

By configuring this as a table, I can easily visualize how many chips each player and the pot have based on the data in this element, which would not be possible if this was a control and would be a hassle if this was a vertical table.
When using “wide” tables like this, I’ve learned a best practice: assign a unique ID column to the single row of these input tables. Then, create a control that holds this ID. This method makes writing and managing action formulas much more consistent and reliable.
On the other hand, to manage the flow of the game, I created a segmented control. Now we can model and reference the active phase of the game. Additionally, but using the “Set Control” action we can easily update the currently active phase.
![]()
Conditional Action Sequences
Conditional action sequences are easily one of Sigma’s most powerful features, and they were the key to making this poker simulation effective. I used a series of conditional action sequences which manage updating the status of the chips table based on who is betting. I used a similar system to update the chips based on who won. The core logic of the game would not be functional without conditional action sequences. Notice how the top bar indicates a custom formula for the condition.

Using Customizable Page Visibility to Keep Hands Hidden
Of course, a poker game isn’t a game if everyone can see the cards! To prevent players from cheating, I used Sigma’s custom page visibility feature. I created separate, private pages for each player and configured the visibility to only show a player’s hand on their designated page. In this demo, I made a private page for Player 2 (my friend, Josias) where he can secretly peek at his cards without anyone else seeing them.

Potential for More
This poker simulator is simply a proof of concept to showcase some of the insane capabilities Sigma allows. As such, I did not add every possible feature one would expect to fully automate the poker playing process. That being said, here are some additional features which Sigma would certainly support:
Betting Phases, Check and Call
It would be relatively easy to add more phases for each players bets and prompt them to complete a modal before moving to the next player.
Folding
This would be pretty easy to implement but take a bit of work to add player fold indicator controls and then change which cards show based on if a player has folded etc.
Automatically Determining the Winner
This one would be more complicated. Involving a folding indicator and a series of lookup tables. Also, technically, ties are possible in poker and my proof of concept does not support them.
Post-Game Report
If we kept track of the changes to each player’s chip pool instead of just or in addition to updating the main row, we could visualize how the chip distribution changed throughout the rounds of the game.
Honestly, it is difficult to think of features that Sigma would not be able to handle.
I was so impressed by how quickly this came together, how effective and good it looked. Sigma is a powerful tool if you know how to use it. What features do you think would make this app even cooler? What project should we make in Sigma next?
