URL Parameters with Experience Builder - Send Your Users!

562
4
3 weeks ago
BrianBaldwin
Esri Regular Contributor
4 4 562

Experience Builder recently (in the last release) included the ability to have a few different URL parameters. Honestly – URL parameters are nothing that I have used… but I’ve found that they can be really valuable to provide a targeted way to drive viewers to a specific feature or location.

If you want to look at the current URL parameters for Experience Builder, the documentation can be pulled up here: https://doc.arcgis.com/en/experience-builder/latest/build-apps/url-parameters.htm

If you peruse this list, you’ll see it’s short on map specific URL parameters. Notably, one of the questions/needs I had from a user was related to loading up a feature at a specific zoom scale.

Currently, Experience Builder does not include a URL parameter for an ‘extent’ or ‘scale’ – so it seemed that there was no way to load a selected feature and then ‘zoom to’ with a URL. Yet, using the ‘pages’ functionality of Experience Builder – there is a workaround for creating a standard app that also has a ‘url parameter zoom to specific feature’ functionality.

In my example – I have a basic web application showing the street network of San Bernardino County. The app works, but I also want the ability to send users to specific street segments when the app opens. So… how can I do it without the ‘zoom’ url parameter?

Here is the link to my app – feel free to play around with the parameters/URL as well: https://experience.arcgis.com/experience/29285b535d614faaa60b599fc111d775/

 

1 - Main App.PNG

 

The first trick – is to use the ‘page’ functionality that is found in Experience Builder. After I have my application built out, I just duplicated it under the pages section.

 

1 - Duplicate.PNG

 

You can then rename your pages, which will be used in the URL. After you have your second page created, go to the settings for the map object and modify the initial view of the map. It doesn’t matter where you focus on, just what zoom scale you use.

 

3 - Initial View.PNG

 

After you have done this, you are basically done. You can save and publish your app.

The first URL parameter is simply the ‘page’ parameter – my original/normal app can use the default URL, or the URL to the specific page as shown here:

https://experience.arcgis.com/experience/29285b535d614faaa60b599fc111d775/page/Full

But if I want to drive users to a specific feature at the zoom scale I pre-defined, I need to use the other page that I created along with the details of the specific feature. For my app, the data, and my feature, that would look something like this:

https://experience.arcgis.com/experience/29285b535d614faaa60b599fc111d775/page/Zoom?data_id=3b8b7d77...

If I want to change the feature that gets selected in the map, I can modify it manually, or you could do this programmatically as well. If you want to play with it manually, just modify the last characters in the URL following the ‘A’ character. This is the ObjectID for the feature.

For example, take the URL: https://experience.arcgis.com/experience/29285b535d614faaa60b599fc111d775/page/Zoom?data_id=3b8b7d77...

Then replace ‘50965’ at the end of the URL string with ‘50089’, ‘32219’, or try any number!

 

URL Parameters.gif

 

That's it! Hopefully this helps a few people utilize URL parameters and a little Experience Builder trickery to create an experience that is tailored to your users needs.

4 Comments
KansasGeologicalSurvey
New Contributor

Great how-to, I used this on a test map and it's working well. Thanks!

Is there a way to zoom to a feature using a non-object ID field? Like a way to pass in an in-house ID number instead of the AGO object ID?

BrianBaldwin
Esri Regular Contributor

Great question @KansasGeologicalSurvey - right now - it does not look like that's possible - but I'll see if @Jianxia or someone from the ExB team can help answer the question - or let us know when that type of capability might be available with URL parameters. Thanks!

Jianxia
Esri Regular Contributor

@KansasGeologicalSurvey Support for App URL parameters in Experience Builder is planned for Q4 2023. See Experience Builder 2023 roadmap.

PaulGiroux1
New Contributor III

Have you been able to get this to work with editing widget? In my app, when I pass the id in, it selects but it does NOT trigger a zoom. It does select the feature on the map and in table but does NOT trigger a change on the Edit or other widgets on the page.

It's sorta half working. Is there something I need to config in Web Experience Builder itself?

Maybe I'm missing data actions and bindings on the map widget or something?

Selection_half_a__ed.JPG

 

About the Author
Brian works as a Solution Engineer at Esri to support customers in Education. Brian has worked as a lecturer in GIS, supported non-profits through his community planning work, and honestly just loves working with users to help solve their geospatial quandaries!