De-mystify Experience Builder URL parameters

1871
11
Jump to solution
09-24-2020 01:22 PM
JayJohnsonWashoeCounty
Regular Contributor

When I navigate to different features in Experience Builder I see a URL that (apparently) includes some identifier related to either the feature I've clicked on or maybe the location.  Can anyone de-mystify the RED part of the Experience Builder URL below?  Maybe Jianxia Song‌?

https://experience.arcgis.com/experience/2fe9e44b691a4e32a9f0b84df16531c0?data_id=dataSource_3-Elect... 

Obviously, what I'd like to do is be able to build URL strings to be able to direct users from an external web page to a specific location/feature within Experience Builder.

However, even though this portion of the URL appears to change as you navigate to different features/locations, it doesn't APPEAR to do anything at all if you past the whole URL into a new browser tab.  

Thanks,

Jay

Jay
Washoe County GIS
Tags (2)
1 Solution

Accepted Solutions
Jianxia
Esri Regular Contributor

Jay,

Unlike Web AppBuilder,  Experience Builder uses the structured URL. As a result, the URL for an experience contains its state information directly, so a user can easily share, without relying on a dedicated state component such as URL parameters in WAB, in order for others to see the experience in the same state. The structured URL is made up of the URL path and the URL parameter. The URL path is constructed for an experience or a web site to be deeply indexed therefore easily searchable by Google and other third-party search engines. The experience id and page default to the URL path, for example, <root path>/<appId>/page/<pageId>. On the other hand, the view, data, and  others follow the URL parameter (aka query parameter), commonly used by ArcGIS web apps. For example,  ?views=<viewId1, viewId2>  defines which views to show when an experience is loaded. An experience url may look something like this:

<root path>/<appId>/page/<pageId>/?views=<viewId1, viewId2>&data_.id=<1>

Currently, Experience Builder has these main URL query parameters:

  • ?views=v1, v2,..: As Experience Builder supports multiple views in a page, this stores user currently selected views
  • ?dlg=dialog1: this stores user currently opened dialog (window)
  • ?data_id=dsId:id1+id2 : this stores user currently selected data records

Although the example you mentioned does not seem making any difference, the following example shares the exact state I am seeing with you other than the default:

//experience.arcgis.com/experience/5947e2d55c1846e1b4952851aa97efe8/page/page_5/?data_id=dataSource_...

Does it make sense? I would recommend to use the Share widget to get the shorten url for sharing though, if applicable. Also. would it be helpful if we document the url pattern as mentioned?


Thanks,

Jianxia

View solution in original post

11 Replies
Jianxia
Esri Regular Contributor

Jay,

Unlike Web AppBuilder,  Experience Builder uses the structured URL. As a result, the URL for an experience contains its state information directly, so a user can easily share, without relying on a dedicated state component such as URL parameters in WAB, in order for others to see the experience in the same state. The structured URL is made up of the URL path and the URL parameter. The URL path is constructed for an experience or a web site to be deeply indexed therefore easily searchable by Google and other third-party search engines. The experience id and page default to the URL path, for example, <root path>/<appId>/page/<pageId>. On the other hand, the view, data, and  others follow the URL parameter (aka query parameter), commonly used by ArcGIS web apps. For example,  ?views=<viewId1, viewId2>  defines which views to show when an experience is loaded. An experience url may look something like this:

<root path>/<appId>/page/<pageId>/?views=<viewId1, viewId2>&data_.id=<1>

Currently, Experience Builder has these main URL query parameters:

  • ?views=v1, v2,..: As Experience Builder supports multiple views in a page, this stores user currently selected views
  • ?dlg=dialog1: this stores user currently opened dialog (window)
  • ?data_id=dsId:id1+id2 : this stores user currently selected data records

Although the example you mentioned does not seem making any difference, the following example shares the exact state I am seeing with you other than the default:

//experience.arcgis.com/experience/5947e2d55c1846e1b4952851aa97efe8/page/page_5/?data_id=dataSource_...

Does it make sense? I would recommend to use the Share widget to get the shorten url for sharing though, if applicable. Also. would it be helpful if we document the url pattern as mentioned?


Thanks,

Jianxia

View solution in original post

JayJohnsonWashoeCounty
Regular Contributor

Thanks Jianxia.  Yes, documenting the URL pattern was exactly what I was looking for.

I'll try to work with what you have above to see if I can get where I need to be.

From within my Experience, I click on a specific feature and the webmap pans to that feature.  The URL in the browser becomes this:

https://experience.arcgis.com/experience/2fe9e44b691a4e32a9f0b84df16531c0?data_id=dataSource_3-Elect... 

The first part is my ExpBuilder app URL and the hosted layer that contains the feature I've clicked on:

https://experience.arcgis.com/experience/2fe9e44b691a4e32a9f0b84df16531c0?data_id=dataSource_3-Elect...

But AFTER that, there is a mysterious string of numbers that I can't interpret:  _5103_3112_2857_6478_6139%3A397

It does not appear that those numbers are a straight-forward reference to the selected feature.

Jay

Jay
Washoe County GIS
JanSarata
Esri Contributor

Hello @Jianxia ,

I would like to ask you for the additional questions to this topic.

  1. Is it possible to turn off this functionality? Turn off this automatic state parameters in URL?
  2. Do you plan to add another state parameters such ZOOM or EXTENT?

Thank you in advance for you answer.

Jan

Jianxia
Esri Regular Contributor

Hi Jan,

Would you mind letting us know the reason that you'd like to turn off the state parameters in URL?

Yes, adding more state parameters like zoom and extent, similar to WAB url parameters, is on the road map. Will update you once we have a timeline.

Thanks,

Jianxia

0 Kudos
JanSarata
Esri Contributor

Hi @Jianxia ,

firstly, thank you for you respond.

Secondly, the reason to switch url states off is to ease the process of testing new Experience Builder app/widget while developing. If I need to refresh the app/builder to see the changes, the state is preserved. But in some testing scenarios it would be fine to have it always at its initial state.

So basically the reason is for testing/developing purposes.

Thank you,

Jan

Jianxia
Esri Regular Contributor

A good point Jan.

An enhancement to turn off the state URL during development and testing has been submitted. 

Thanks,

Jianxia

 

JanSarata
Esri Contributor

Thank you @Jianxia 

0 Kudos
JanSarata
Esri Contributor

Hi @Jianxia ,

could I ask you if there is any update regarding turning off the automatic URL state parameters?

I have another scenario where I need to have them switched off.

We are developing (off panel) ExB widget which takes URL parameters (ids and layer names) and select and zoom to that features in map.

Thank you,

Jan

0 Kudos
Jianxia
Esri Regular Contributor

Hi @JanSarata , this issue is currently in the backlog. Thanks for sharing the use case. I will add it in.

0 Kudos