Select to view content in your preferred language

Help setting up custom ExB URL parameters

139
3
a week ago
DaveK
by
Occasional Contributor

Hello! 

I'm trying to set up a custom URL which filters data within an ExB site. I'm referencing the syntax from this page, specifically the Filter data sources section - https://doc.arcgis.com/en/experience-builder/latest/build-apps/url-parameters.htm

 

The URL example I'm modeling mine after this - 

http://experience.arcgis.com/experience/<AppID>/?data_filter=dataSource_1:name%3D%27Even%26Odd%27

I can't seem to figure out what should be placed in the "dataSource_1" section. Is it supposed to be the URL of the service, the item ID, or item name? Also, is the field I'm filtering on placed in the "name"? Do I place the query value after the "%3D"? Does anyone have a better example of a custom URL? Any help is appreciated. 

Thanks. 

0 Kudos
3 Replies
RyanUthoff
Regular Contributor

The instructions in the Select data section of your documentation (right above the Filter data sources section you referenced) explains how to retrieve the data source ID.

"Each data source in an app has its own data source ID. When you select a data record, the data source's ID is added to the app's URL, along with the selection type and selection condition. " So you would replace "dataSource_1" with the data source ID using the workflow above.

Regarding the field you're filtering on, below is an example from their documentation on what it would look like. So from your example, you would replace "name" with your field name.

"The following is another example URL with two encoded filter parameters (objectid=1 and fieldA>2):"

https://experience.arcgis.com/experience/<AppId>/?data_filter=ds1:objectid%3D1,ds2:fieldA%3E2

 

DaveK
by
Occasional Contributor

Thanks for the information @RyanUthoff

I have a single layer in my ExB app. Can you confirm that this URL syntax seems right? The map doesn't seem to filter after opening. 

 

 

https://experience.arcgis.com/experience/f5d4e46786144f04b0d0ef95a766adbf/?data_filter=dataSource_1:yii_group%3DTest%20Group

 

0 Kudos
RyanUthoff
Regular Contributor

The only thing I see is since you're searching for a text value, I believe you need to put the value you are searching for in single quotes, which would be %27 as the encoded value. Below is an example of what that would look like.

RyanUthoff_0-1722445466329.png

 

The other thing is that you might need to replace "dataSource_1" with the actual data source ID you're using.

0 Kudos