URL Parameters - filter multiple values for a single data source

261
1
02-21-2024 01:22 PM
RInfante
New Contributor III

Hello!

So this question applies to Experience Builder running on Enterprise 11.2.

Just like the subject says: I am trying to embed an app and want to use URL parameters to filter the records based on two different values of the same attribute, and in the same data source.

So for example, I have dataSource1 and a column called 'test' with the values 'a' and 'b'.

If I wanted to use an URL to just show the records related to "test=a', the syntax would be:

<url>&data_filter=dataSource1:test='a'

Likewise, if I wanted to filter by b, it'd be:

<url>&data_filter=dataSource1:test='b'

But what if I wanted to filter by both 'a' and 'b'? Everything I've tried so far excludes one of the parameters, and the documentation about passing multiple filters assumes multiple data sources and columns instead of from the same one. Is this just not possible in Experience Builder the way it is with Dashboards (ie. in Dashboards, the Category type URL parameter can do this = '#param=a,b')?

 

 

 

1 Reply
Shen_Zhang
Esri Contributor

Hi @RInfante 

The filter format is a standard WHERE clause syntax. To filter data with multiple values, you can use:

<url>&data_filter=dataSource1:test='a' OR test='b'

or

<url>&data_filter=dataSource1:test IN ('a', 'b')

But please remember to encode the filter values in case of the potential conflicts with preserved delimiters:

<url>&data_filter=dataSource1:test%20IN%20(%27a%27%2C%27b%27)
Shen Zhang
0 Kudos