tableau / extensions-api

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

getFiltersAsync() not pulling all values despite being selected #155

Closed ankitppatel closed 1 year ago

ankitppatel commented 6 years ago

I have a dashboard with a series of filters, in which I incrementally reduce my data down using "relevant" values.

The values that are left in my final filter are what I'd like to extract using the getFiltersAsync() method.

If I leave all of the values selected, then the API doesn't seem to recognize that final filter, meaning no filter-values are returned. If I go in and select just a few of the values, then the API seems to recognize and retrieve the subset values in that final filter.

Is this how the functionality was built for this method? Or am I missing something?

Could I go into the source code of the API and change anything to ensure that the method retrieves all of the values selected in a filter (even if ALL values are selected)? Or is the retrieval functionality stored somewhere else away from the API source?

Tableau Desktop version = 2018.2 Tableau Extensions library = tableau-extensions-1.latest.js

lorettaxia commented 6 years ago

+1 from here. If we select (All) inside filter selection pane, there will be no value returned from getFilterAsync().

The issue goes to the 'Filter' tutorial as well. Anyone know how to solve it?

Kovner commented 5 years ago

Thanks for the feedback. If I'm understanding correctly, when 'All' is selected, you don't get any values returned, correct? That is how the API is currently designed, but we have plans to provide a better experience for the 'All' scenario (allow you to check if All is selected, for example. We don't have the exact API change worked out yet).

kostenickj commented 5 years ago

I would consider this a bug. Not an "enhancement". Please fix, it has us dead in the water.

HoraceKeung commented 5 years ago

Any news on this? How do I find out if "All" is selected?

Kovner commented 5 years ago

This is still towards the top of our list of things to do, but it's taken us a bit longer than intended to be able to begin work on it. Sorry for the pain. I will update this thread when we begin work on it.

Kovner commented 5 years ago

Actually we just started working on this and are trying to get it done in time for 2019.2 (though the engineering deadline for that release is soon so there is a chance it is in 2019.2.1). Thanks for all of the feedback here everyone!

lkanikka commented 5 years ago

@Kovner please let us know if you are able to give All filter values , when filter selects All the avaialble values, and 0 or something else when user de-selects 'All' values. I checked in 2019.2.1, fix is not available yet. I get 0 in both cases, ( All selected and All unselected both give 0 )...any updates on this

Kovner commented 5 years ago

Hey @lkanikka, We implemented this but have not yet released the new version of the API (1.3) which will enable it. So you will need 2019.2 and the 1.3 version of the API which will be coming soon. The API design is that the Filter object will have a property called isAllSelected that the developer will check.

lkanikka commented 5 years ago

@Kovner, Thank you for the information. I will wait for the versions to be available. Meanwhile, I have a related question.

When I eventually get isAllSelected property, I would like to set the filter values using 'applyFilterAsync' . For this I need all values available in the filter, to be passed as an array. From where can I get full list of unique values in filter ?

Is it available as a property in the filter object ?

Thank you for your help,

Kovner commented 5 years ago

If the goal is to filter in every value of a field, you don't need to know the domain. You can use the FilterUpdateType.All: applyFilterAsync(, [], tableau.FilterUpdateType.All)

Kovner commented 5 years ago

Oh but to answer the question: we don't have a property that gives you the domain of a field. It is something on our backlog.

lkanikka commented 5 years ago

@Kovner thank you... that helps... will wait for the upcoming version

aksharj commented 5 years ago

Hi @Kovner,

I am facing a similar issue, I am trying to save the filters user has applied and pass it on to a different dashboard.

For this, i am trying to use the getAppliedValues(), but this is not letting me check if the filters was set to ALL, so i can ignore it and not save it on our end.

If i understand correctly, one of your point above says "allow you to check if All is selected, for example. We don't have the exact API change worked out yet"

Is this something already done but not released? if yes, can you please let me know when it would be released, as we are really waiting for this feature.

Many thanks.

Kovner commented 5 years ago

Here you go: https://tableau.github.io/extensions-api/docs/interfaces/categoricalfilter.html#isallselected The CategoricalFilter object now has a property called isAllSelected.

HoraceKeung commented 4 years ago

From https://tableau.github.io/extensions-api/docs/interfaces/categoricalfilter.html, we see When 'All' is selected, appliedValues returns an empty list. Can getAppliedValues() of a CategoricalFilter return all values when "All" is selected? If not, how else can we find out the filters applied when "All" is selected.

johnDance commented 1 year ago

If all is selected, you can get all values with getSummaryDataAsync.