tableau / extensions-api

Extensions API sample code and developer docs.
http://tableau.github.io/extensions-api
MIT License
268 stars 251 forks source link

Filtering of dashboard using tableau extension {Suggestion Required} #299

Closed ssurawdhaniwar closed 2 years ago

ssurawdhaniwar commented 4 years ago

Hi Everyone,

I need to filter dashboard content with help of tableau extension. I am providing drop down filter options in extension and on selection of values through extension container the dashboard values should change. Please refer link for more details: https://community.tableau.com/message/1054764#1054764 Can u please suggest how can this be done?

Thanks in advance Sukriti

johnDance commented 4 years ago

Hi Skriti I answered in the community forum. I'll copy that here. In addition, I would suggest debugging your extension (see the debugging section in https://tableau.github.io/extensions-api/docs/trex_getstarted.html). The console can help point out errors that might be in your code.

Hi Sukriti

When called from initializeAsync, you are not passing the current value, and when called from onClick, you are not passing the fieldName. You should changes both calls to showOnly(worksheet, fieldName, value). Then in the call to applyFIlterAsync, pass value as an array, for example:

function showOnly(worksheet, fieldName, value) { worksheet.applyFilterAsync(fieldName, [value], tableau.FilterUpdateType.Replace). }

By the way, you can remove this script tag. It is not needed for extensions:

Best wishes, John

bcantoni commented 2 years ago

Closing out based on age and John's response. If this is still an issue, please reopen with a comment on the latest status and we can revisit.