Ashish
Ashish

Reputation: 2564

JavaScript runtime error: Object doesn't support property or method 'applyFilterAsync'

I am trying to show a Dashboard in my webpage via Tableau JavaScript api. My dashboard does gets initialized but when I try to filter, it gives me an error as

JavaScript runtime error: Object doesn't support property or method 'applyFilterAsync'

Here's my code where it gives error

activeSheet.applyFilterAsync('Region', 'Asia', tableauSoftware.FilterUpdateType.ADD);

Any idea why this error?

UPDATE: I was however able to use the applyFilterAsync function with the published sheet. Is this function not available for dashboards?

Upvotes: 2

Views: 1429

Answers (1)

PrashSE
PrashSE

Reputation: 217

sheet = viz.getWorkbook().getActiveSheet().getWorksheets()[N]; /* with dashboard it is needed to specify the worksheet number.

sheet.applyFilterAsync(filtername, value, 'REPLACE');

Upvotes: 1

Related Questions