NexBlazers Logo
NexBlazers Learn • Build • Grow
CRM Analytics

One Toggle, Every Chart: How CRM Analytics Bindings Really Work

Written by NexBlazers Architecture Team November 25, 2026 11 min read Interactive

A sales director asks for "the same dashboard, but let me switch between Industry, Region and Lead Source". Another wants the Accounts list to filter a chart built on Opportunities. Out of the box, CRM Analytics does neither: faceting only connects widgets that use the same dataset, and a chart's grouping is fixed when you build it.

Bindings fix both. A binding is a small expression in {{ }} that takes a selection or a result from one query and writes it into another query or widget at runtime. Below you'll build three of them in a playground, watch each one turn into real SAQL, break them on purpose to see the errors, and then check yourself with a quiz.

Naming note: Salesforce's docs now call bindings interactions (the rename came in Spring '20), and queries used to be called steps before Winter '20. Both old names are still everywhere in JSON, blogs and interviews, so this post uses "binding" and "interaction" interchangeably.
Source
A query's .selection or .result
Select
cell, column, row
Manipulate
Optional, e.g. coalesce
Serialize
asString, asEquality…
Try it

The Binding Playground

Pick a use case, click the source widget like a dashboard user would, and switch binding versions to see what CRM Analytics actually runs.

Use case
1. Source widget (click it)

2. Binding version
3. What CRM Analytics does with it
    Resolved target (simplified)
    sample data, $M

    1. Try faceting first, bind when it runs out

    Faceting is the simplest way to connect widgets: a selection in one widget filters the others, with no code. The catch is scope. Faceting only filters queries that use the same dataset, and it only ever filters. As the Get Started with Dashboard Interactions guide puts it, anything outside that scope needs an interaction.

    Reach for a binding when you need to link widgets built on different datasets, or change something other than a filter: the measure, the grouping, the sort, the limit, a chart's colour or a reference line. Bindings can override the parameters you set in the dashboard editor with a value worked out at runtime.

    2. Anatomy of a binding

    Every binding sits inside double curly braces and starts from a source: {{QueryId.selection}} or {{QueryId.result}}. From there it's a chain of functions. Per the Interaction Functions reference, each binding needs exactly one data selection function and one serialization function, with any number of manipulation functions in between.

    {{ coalesce( cell( Group_Toggle_1.selection, 0, "value" ), "Industry" ).asGrouping() }}
    • Source: the query's API ID plus .selection or .result. Use the ID, not the label, and match its case exactly: bindings are case sensitive.
    • Select: cell(source, rowIndex, "column") returns one value, column(source, ["column"]) returns an array, and row(source, [rows], [columns]) returns one or more rows. Row indexes start at 0.
    • Manipulate: optional. coalesce(x, default) returns the default when nothing is selected, which is the fix for most "empty toggle" bugs.
    • Serialize: turns the data into the text the target expects, for example a SAQL filter, a group-by field or a plain string.
    Architecture Note: Match the serializer to the shape of the data. cell gives you a single value, so it pairs with asString(), asEquality() or asGrouping(). column gives you a list, so asEquality() turns it into an in [...] filter and asObject() passes it through as JSON. Get the shape wrong and you get an execution error, which you can see in the playground's third version.

    3. Selection vs results bindings

    A selection binding reads what the user clicked and is evaluated again on every selection. Use it to drive filters across datasets, swap measures and groupings, or change display properties. A results binding reads the output rows of another query. Use it for multi-step calculations (find the top five products, then filter by them), to set an initial filter from the logged-in user, or to change how a widget looks based on the numbers.

    TypeReadsTypical uses
    SelectionQuery.selectionCross-dataset filters, dynamic measure or grouping, dynamic sort, chart and number display properties
    ResultsQuery.resultIntermediate calculations, initial selection from user attributes, reference lines, colour coding from values

    The Trailhead project Use Bindings to Compare Data builds exactly the reference-line case from the playground: it replaces a hard-coded 30,000,000 with cell(Account_Owner_1.result, 0, "C").asString(), then turns off Apply global filters on the average query so the benchmark stays put when users filter. Leave it on and the line follows the filter, which may or may not be what the business wants. Ask.

    4. Pick the serializer for the target

    The SAQL serializers each write a different piece of a query. These examples follow the Build Data Serialization Interactions page:

    -- equality filter (one value → ==, a list → in [...])
    q = filter q by {{cell(StaticFilterDim_1.selection, 0, "value").asEquality("Account_Type")}};
    --> q = filter q by 'Account_Type' == "Customer";

    -- measure range from a min/max pair
    q = filter q by {{cell(StaticFilterRange_1.selection, 0, "value").asRange("Amount")}};
    --> q = filter q by 'Amount' >= 2910928 && 'Amount' <= 8577295;

    -- dynamic grouping
    q = group q by {{cell(StaticGroup_1.selection, 0, "value").asGrouping()}};
    --> q = group q by 'Industry';

    -- date range on a date field
    {{cell(StaticFilterDate_1.selection, 0, "value").asDateRange("date('Close_Date_Year', 'Close_Date_Month', 'Close_Date_Day')")}}

    There's also asProjection() for a field in a foreach, and asString() / asObject() for anything that isn't SAQL, such as widget properties and JSON parameters. Queries written in SOQL or SQL get their own serializers (for example asSQLWhere), because the SAQL ones would produce the wrong syntax.

    5. Open the dashboard filtered to the user

    A favourite results binding: a regional dashboard that opens already filtered to the viewer's country. You add a SOQL query that reads the current user, then bind the list widget's initial selection (start) to its result. From Bind the Initial Filter Selection:

    "UserData": {
      "type": "soql",
      "query": "SELECT Username, Country, FirstName, LastLoginDate FROM User WHERE Name = '!{user.name}'",
      "strings": ["Username", "Country", "FirstName", "LastLoginDate"],
      "numbers": [], "groups": [],
      "selectMode": "single"
    }

    // on the list widget's query (e.g. Billing_Country_2)
    "start": "{{ cell(UserData.result, 0, 'Country').asObject() }}"

    Only staticflex, saql and soql queries can take a binding for their initial selection, and the field you read (Country) must be listed in the query's strings.

    6. The gotchas that cost a day

    • Binding a measure or grouping on a chart? Replace the widget's columnMap with an empty columns array. The Interactions guide calls this out in its measure, grouping and nested-interaction examples. (If you need a fixed order of multiple measures or groupings, bind columnMap itself instead, in both the query and the widget.)
    • Escape inner quotes. Bindings live inside JSON strings, so "value" inside the binding must be written \"value\". A missed escape is the classic validation error: CRM Analytics can't parse the binding at all.
    • Wrong shape is an execution error. The binding parses but the data isn't what the function expects, for example a row arriving where a single cell was expected. The widget shows the error and the message tells you what to change.
    • Not every property can be bound. Widget properties are bindable only on chart and number widgets. Even there, borderEdges, borderWidth, exploreLink and measureField (plus a few others) are off-limits, and you can't bind a query's selectMode.
    • Explorer drops some bindings. Bindings on widget titles, subtitles and dynamic reference lines are ignored when someone opens the widget in an explorer lens.
    • Plan for "nothing selected". Wrap selections in coalesce() with a sensible default, or give the toggle an initial selection.

    You don't have to type all of this by hand any more: the Advanced Editor lets you build many interactions with clicks (see Create Interactions with Clicks in Help). Knowing the syntax still matters, because that's what you'll be reading when one breaks.

    Interview-ready

    Predict the Outcome

    Six binding scenarios from real dashboards and the CRM Analytics consultant exam.

    Question 1 of 6 Score: 0

    Cheat sheet: which binding do I write?

    You need to…BindingWatch out for
    Filter a chart on another datasetcolumn(Q.selection, ["F"]).asEquality("F")cell keeps only the first pick
    Let users switch the groupingcoalesce(cell(Q.selection, 0, "value"), "F").asGrouping()Swap columnMap for columns: []
    Draw a line from another query's valuecell(Q.result, 0, "col").asString().result, not .selection; decide on global filters
    Open filtered to the user"start": "{{ cell(User.result, 0, 'Country').asObject() }}"SOQL query with !{user.name}
    Filter a SQL or SOQL query….asSQLWhere(…)SAQL serializers won't fit
    Keep learning

    Official Resources

    Straight from Salesforce: the docs this article is based on.

    Dashboards your leaders still export to Excel?

    We'll review your CRM Analytics dashboards and wire up the bindings that make them self-serve.

    Book a Dashboard Review

    All information in this article was collected from publicly available resources, including official Salesforce documentation.