embedding-api-v3-guide icon indicating copy to clipboard operation
embedding-api-v3-guide copied to clipboard

selectMarksByValueAsync function doesn't select the data correctly in a Viz

Open rdelhaise-wiiisdom opened this issue 7 months ago • 0 comments

Hello, We recently found out that the selectMarksByValueAsync function is not working properly with a RangeValue as SelectionCriteria.

We used a sample workbook that you can find in the attached file to open a viz on Tableau Cloud with the latest version of the embedding API. The worksheet represents a SUM(Sales) graph; we want to select every mark between 0 and 20,000.

Steps to reproduce:

  1. Open the viz.

  2. Create a SelectionCriteria as follows:

{
      fieldName: "SUM(Sales)",
      value: {
        min: 0,
        max: 20000
      }
}

Note: we did not add a nullOption here as it's not mandatory but we also tested with all the possible nullOptions.

  1. call the selectMarksByValueAsync function with the select-add selectionUpdateType.

Observed behaviour:

=> Many marks are selected even the ones outside the 0 < value < 20 000 range.

-OR-

=> No values are selected

Expected behaviour:

=> Only the marks in the 0 < value < 20 000 range are selected.

Note: We created a glitch.io with minimalist code to reproduce this issue easily:

  1. Click on the load button (you potentially need to manually log to Tableau if the token is not present on your browser)
  2. Click on the "Select marks" button

If the link to the viz to open does not work, you can easily edit here on l.12 of script.js

Worksheet | Embedding API

rdelhaise-wiiisdom avatar Jul 15 '24 14:07 rdelhaise-wiiisdom