De-mystify Experience Builder URL parameters

9282
35
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

35 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

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
vonmoosa
MVP

Any update on this @Jianxia ? 

0 Kudos
AnnaHradecká
New Contributor III

Hi, 

I¨ve read conversation below, but still don't understand the the mysterious string of number as @JayJohnsonWashoeCounty  refer. ;What type of ID is used after "%" and is it possible to change it to more useful one to navigate to feature only by change the id in URL?

0 Kudos
Jianxia
Esri Regular Contributor

@AnnaHradecká and @vonmoosa, thank you for your feedback. We plan to document these url parameters and will inform of you.

0 Kudos
Stacy-Rendall
New Contributor III

Hi @Jianxia - is the documentation of existing Experience Builder URL parameters available yet?

Stacy-Rendall
New Contributor III

And now to answer my own question, in case it helps anyone... In Experience Builder developer edition you can check the following file for some basic documentation of the URL parameters:

`/ArcGISExperienceBuilder/client/jimu-core/lib/types/url-parameters.d.ts`

0 Kudos
Jianxia
Esri Regular Contributor

Hi @Stacy-Rendall , we plan to document the url parameters in the next release. Thanks for sharing the file.

0 Kudos
AlejandroMari1
New Contributor III

Hi @Jianxia , any plans to allow disabling this? We are running into issues with ExB generating very long URLs, so I'd like to completely hide all URL arguments from the users.

0 Kudos