Creating Binding Toggles in Salesforce Analytics Studio │2022

Vinícius Ramos
4 min readJun 27, 2022

Some companies view Salesforce Analytics Studio, previously called Tableau CRM, Einstein Analytics and some other names, as a BI tool for internal Salesforce data, but in reality it is a lot more than that! And how to use its internal program language to your advantage is what we’re going to talk about today.

Binding Toggles are, in simple terms, selection panels that can change a graph completely with a simple click! This helps a lot in user experience and Dashboard layout because it prevents it from having multiple visualizations with the same data just segmented by different categories!

In case you’re wondering how it looks like in Analytics Studio, here’s a gif:

What we want to have at the end is something like this, where you can select the categories not only as filters but also as grouping criteria!

The real question is if this is hard to do, and the answer is no! It’s a bit tricky if you don’t have a resource, but with the following instructions you’ll be able to complete it in no time!

How do perform it and apply to Dashboards

  1. Go to Create Query or a Component (Toggle, List, Display…) inside your Dashboard and instead of selecting a Dataset, select the option Create Custom Query

2. Select the field reference based on the Dataset, and it can also work for multiple datasets, it’s a simple map of the display text you want the user to see and to which column in the dataset it’ll correspond to!

3. After saving, you’ll have something called Static Query, then go to Query Editor on the right side of the menu with the static selected and choose the option Single Selection (required).

4. Now create the Query you want to change by the binding relationship, it can be multiple and it can work in almost any chart type.

5. After saving the query and the graph, go to the Advanced Editor to Edit it in SAQL at the bottom right options, or using the right side menu

6. Pay attention because these are a lot of steps:

Create the Binding and Query Relationship by going to the Advanced Interaction Editor, then select the query. After that, select which Column is going to represent dimensions, this is the column correspondent to Dataset columns. Select the type, generally it'll be Column, and put Interaction Type as Selection. Open More Options and put Data Serialization Functions as asObject!

Illustration and Example

7. After doing that, a string will be shown below the query itself, copy it!

8. To Apply the Interaction in the SAQL Query go to the Query Editor, search for “Groups” and replace all the Categorical fields inside the Group by functions for the Interaction string.

9. Now, switch to the Widget JSON Editor and search for columnMap section.

Now it’s where some things change, because it’ll depend in the graph and visualization type you want to apply it to! Here’s how to handle some common examples:

Toggle to change Categorical Group By: erase the hole map and put a Null in place

Toggle to change Second Categorical Group By (Stacked, Multiple Groups):

Erase only the desired group string and replace it with the copied relationship!

Toggle to change Trellis Category:

Erase only the Trellis brackets and replace it with the relationship

--

--

Vinícius Ramos

Data Scientist & Professor helping you with Decision Intelligence. 🦊 Decision Intelligence, Analytics, Statistics & Project Management www.varzdecisions.com