1

I currently building a dashboard and I am trying to add a value table with a toggle, that would switch custom filters for that table. I am using this, since I want to have custom filters which would filter Opportunity fields: Priority and Stage. For example, one filter would select opportunities with stage equal to "new", "marketing", "bid" the other only with stage equal to "lost" and so on. Since value tables have "grain" as step type, this can be done only using the Classic Dashboard Designer syntax. How can I do that properly?

In the Table step I added the following binding:

"filters": "{{ selection(Filter_By_1) }}"

whereas in the target toggle step:

"values": [
                {
                    "display": "Budget",
                    "value": [
                        "STAGE_NAME",
                        [
                            "0 - New Opportunity",
                            "1 - Marketing",
                            "2 - Pre-Bid",
                            "3 - Bid",
                            "4 - Competition",
                            "4 - Negotiation"
                        ],
                        "in"
                    ]
                },
                {
                    "display": "Lost",
                    "value": [
                        "STAGE_NAME",
                        [
                            "7 - Project lost"
                        ],
                        "in"
                    ]
                },
                {
                    "display": "Shift",
                    "value": [
                        "STAGE_NAME",
                        [
                            "5 - Project on hold"
                        ],
                        "in"
                    ]
                },
                {
                    "display": "Out",
                    "value": [
                        "Opportunity.Priority__c",
                        [
                            "D - No bid"
                        ],
                        "in"
                    ]
                }

Now, whenever I click the filter, there are no results shown in the table, whereas I am 100% sure that there should be, since there are opportunities matching this criteria. What might be the error here?

1

I needed to use a saql Step Type to get a filter binding to work for a table (using a table visualization), then use Dashboard Designer syntax. Looks something like below using the Trailhead Analytics Product Pipeline USA dataset.

Note that if you have a toggle that has multiple values (STAGE_NAME in the OP), you'll need to use the flatten function to get the static returned value in the proper format.

You could shortcut the viz parameters by creating a values table step in the editor, then altering the JSON for a saql step type.

"lens_1": {
            "query": "q = load \"ProductPipelineUSA\";\nq = filter q by {{ flatten(column(Stage_1.selection, [\"value\"])).asEquality(\"Stage\") }};\nq = foreach q generate 'Account','Owner','Product','Stage';",
            "type": "saql",
            "visualizationParameters": {
                "options": {},
                "parameters": {
                    "borderColor": "#e0e5ee",
                    "borderWidth": 1,
                    "cell": {
                        "backgroundColor": "#ffffff",
                        "fontColor": "#16325c",
                        "fontSize": 12
                    },
                    "columnProperties": {},
                    "columns": [],
                    "customBulkActions": [],
                    "header": {
                        "backgroundColor": "#f4f6f9",
                        "fontColor": "#16325c",
                        "fontSize": 12
                    },
                    "innerMajorBorderColor": "#a8b7c7",
                    "innerMinorBorderColor": "#e0e5ee",
                    "maxColumnWidth": 300,
                    "minColumnWidth": 40,
                    "mode": "variable",
                    "numberOfLines": 1,
                    "totals": true,
                    "verticalPadding": 8
                },
                "type": "table"
            }
        },

Reference:

Analytics Developers Binding Guide | Filters

Analytics Dashboard JSON Reference | saql Step Type Properties

| improve this answer | |
0

you might wanna try this in your table chart "{{column(Filter_By_1.selection, [\"value\"]).asObject()}}"

a great resource for this: https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_bindings.meta/bi_dev_guide_bindings/bi_dbjson_bindings.htm

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.