If you want to set filters without the interaction manager (the IM won’t exist in the app), then you’ll need to manually set the filter directly to the visualization with .filters()
, .clientFilters()
or .staticFilters()
. In any case you just need that the filter path matches a field name in the source of that visualization.
In any other case (when the IM is in the app), the filter will be evaluated based on its label. This is what ensures the Multi-source filtering.
If you have two fields that are named differently in two different sources, ie: “name” and “person_name”, but they represent the same data, you just need to set the same label for both of them at metadata level. The IM will know that it’s referring to the same field.
The opposite also happens: Two fields named as the same, let’s say both are stored as “name”, but the one if for persons, the other for institutions, then you will have to label them differently at metadata level to ensure that a filter with path “name” will never be incorrectly applied.
When the filter is applied by clicking a visual, the IM will automatically evaluate that filter to find any equivalent across sources based on the label, and it always respect the rules I explained before.
If instead you are passing the filters yourself straight to the IM (using the IM API), and you have not defined any metadata, then make sure the filter objects passed have the label property (with .label()
) to ensure the compatibility, otherwise it will ignore the filter even if the path matches a field name in the datasource.
Hope it helps.