Skip to main content

Hi All,

 

I have a categorical filter which I am trying to populate using the JS API, The filter has values like

Test 11X-33 (1507321121), Str 12Y-34 (1765215376) displayed in a dropdown.

 

I am trying to set the value of the filter but every time i am getting "invalidFilterFieldValue" in response.

 

let activeSheet = tableauViz.getWorkbook().getActiveSheet();

const worksheets = activeSheet.getWorksheets();

for (let worksheet of worksheets) {

  if (worksheet.getName() == 'Filter') {

    let filterd_values = ['Test 11X-33 (1507321121)', 'Str 12Y-34 (1765215376)'];

    //let filterd_values = 'Test 11X-33 (1507321121)';

    worksheet.applyFilterAsync("name", filterd_values, 'replace').then(function(res) {

      console.log(res);

    }, function(err) {

      console.log(err);

    });

  });

}

 

Any ideas on how to fix would be really helpful. Thanks.

1 risposta
  1. 3 ago 2020, 19:22

    Hi Akshar, Assuming this is a duplicate of your previous question. The way you are calling applyFilterAsync() looks fine, the error you're getting is likely because the value you are submitting isn't found within the filter.

    -Keshia

0/9000