Skip to content

URL parameters in ArcGIS Experience Builder

Diagram showing how URL parameters control Experience Builder components
Diagram of how URL parameters control Experience Builder components.

ArcGIS Experience Builder supports URL parameters which provide a configurable way to control and customize how your application behaves when it loads. This capability allows developers and administrators to create a targeted user experience by passing specific values through the browser URL. Whether you want to zoom to a particular feature or pre-select data, URL parameters offer an effective way to create dynamic experiences.

What are URL parameters?

When you create and publish an experience in ArcGIS Experience Builder, the builder generates a unique URL. This URL can be changed to include parameters that control the behavior of your application. URL parameters are often used to pass information to your application such as feature IDs, map extents, or filter criteria. By using URL parameters, you can create deep links that allow your users to access specific content or functionality in your experience.

In general, URL parameters are added to your experience URL after a question mark ?. Multiple parameters are separated by ampersands &. Here is the basic url syntax for URL parameters:

Use dark colors for code blocksCopy
1
https://experience.arcgis.com/experience/{AppID}/[?parameter1=value1&parameter2=value2&...]

Where:

  • {AppID} is the ID of your experience.
  • ? indicates the start of the URL parameters.
  • & separates multiple parameters.
  • {parameter} is the name of the URL parameter.
  • {value} is the value of the URL parameter.

Optionally, you can also include # followed by a fragment name as an identifier in the URL. It is used to navigate to a specific part of the page, specify a widget, or a data source. Below is an example of a URL with a fragment identifier:

Use dark colors for code blocksCopy
1
/{AppId}/#data_s=id:{data_source_ID}:{OBJECTID}&zoom_to_selection=true

Where:

  • # indicates the start of a fragment identifier.
  • : separates the parameter name from its value.
  • {data_source_ID} is the ID of the data source in your experience.
  • {OBJECTID} is the Object ID of the feature you want to select.

Why use URL parameters?

URL parameters are important for creating interactive experiences. Here are some key use cases:

  • Share filtered data views with stakeholders.
  • Pass data between different ArcGIS applications.
  • Integrate with external systems by sharing context through URLs.
  • Set initial map extents for different use cases.
  • Create automated processes that launch experiences with specific configurations.

Common URL parameters

Below are some common URL parameters you can use in ArcGIS Experience Builder:

You can also use the page parameter to navigate to a specific page in your experience. This is useful when sharing specific views with others.

Use dark colors for code blocksCopy
1
https://experience.arcgis.com/experience/{AppId}/page/{page_id}

Where AppId is the ID of your experience, and page_id is the ID of the page you want to navigate to.

You can find the page ID in the Experience Builder settings. To find the ID of a page:

  1. Open your experience in Experience Builder.
  2. Select the page in the Page panel.
  3. Look for the Page ID in the Settings panel.

Data source parameters

Experience Builder allows you to select and filter data sources using URL parameters. This is useful when opening your experience with specific data selections.

Select and zoom to features

To select data in a the map widget, you need to use the #data_s parameter. This parameter allows you to select a specific feature in a feature layer and zoom to it.

Use dark colors for code blocksCopy
1
https://experience.arcgis.com/experience/{AppId}/#data_s=id:{data_source_ID}:{OBJECTID}&zoom_to_selection=true

The URL parameters do the following:

  • id:{data_source_ID}:{OBJECTID}: Selects the feature with the specified ObjectID in the specified data source.
  • zoom_to_selection=true: Zooms the map to the selected feature.

You can select multiple features by using the + operator. For example:

Use dark colors for code blocksCopy
1
#data_s=id:{data source ID}:300+302+371&zoom_to_selection=true

Filter data

You can configure your experience to show only specific data in the map widget based on your requirements. To do that, you can filter your data sources directly by using the #data_filter parameter. This parameter allows you to filter data in a feature layer based on specific attributes.

Use dark colors for code blocksCopy
1
https://experience.arcgis.com/experience/<AppId>/?data_filter={dataSource_id}:{where_clause}

Here is an example of a URL that filters data:

Use dark colors for code blocksCopy
1
http://experience.arcgis.com/experience/<AppID>/?data_filter=dataSource_1:name='Even&Odd'

In this example, the URL filters the data source with ID dataSource_1 to show only features where the name attribute is equal to Even&Odd.

You can find the data source ID in the Experience Builder settings. To find the ID of a data source:

  1. Open your experience in Experience Builder.
  2. Select the data source in the Data panel.
  3. Look for the Data Source ID in the Settings panel.

Map parameters

The map widget supports several URL parameters to control its behavior. Below are some common parameters.

Set map extent

The map widget supports the #extent parameter to set the map extent. This is useful for creating deep links that open the map at a specific location.

Use dark colors for code blocksCopy
1
https://experience.arcgis.com/experience/<AppId>#{mapWidgetID}=extent:xmin,ymin,xmax,ymax

The extent parameter takes four values: xmin, ymin, xmax, and ymax. These values define the bounding box of the map extent.

Zoom to extent

You can configure your experience to zoom to a specific extent in the map widget. This is useful when opening your experience with a specific map view.

Viewpoints are used to set the map extent and rotation. Using JSON format, you can use the #viewpoint parameter to set the map viewpoint.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
 {
  "rotation": 0,
  "scale": 200000,
  "targetGeometry": {
    "spatialReference": {
      "latestWkid": 3857,
      "wkid": 102100
    },
    "x": -9870655.016044471,
    "y": 4724533.527708739
  }
}

The viewpoint parameter takes a JSON object with the following properties:

  • rotation: The rotation of the map in degrees.
  • scale: The scale of the map.
  • targetGeometry: The target geometry of the map, which includes the spatial reference and coordinates.
Use dark colors for code blocksCopy
1
https://experience.arcgis.com/experience/{AppId}#{mapWidgetID}=viewpoint:{"rotation":0,"scale":19966005.903731048,"targetGeometry":{"spatialReference":{"latestWkid":3857,"wkid":102100},"x":-9870655.016044471,"y":4724533.527708739}}

Widget parameters

You can use URL parameters to control the behavior of widgets in your experience. This is useful for creating deep links that open your experience with specific widget configurations.

Here is the basic URL parameter syntax for widgets:

Use dark colors for code blocksCopy
1
https://experience.arcgis.com/experience/<AppId>#widget_1=param1:{value},param2:{value}&widget_2=param1:{value}&...

Center the map

You can center the map on a specific feature using the #{map_widget_id}=center:{value} parameter. This is useful when opening your experience with a specific map view.

Use dark colors for code blocksCopy
1
https://experience.arcgis.com/experience/{AppId}#{mapWidgetID}=center:{x,y,wkid}
Use dark colors for code blocksCopy
1
https://experience.arcgis.com/experience/<AppId>#map_1=center:-10373125.398783844%2C4598516.55871741%2C102100

In example above, the URL:

  1. Centers the map on the coordinates -10373125.398783844 and 4598516.55871741
  2. Spatial reference is set to 102100.

Examples

Here are some examples of how to use URL parameters.

Display selected feature info

This example shows you how you can link URL parameters to create a complex workflow. You can open a specific page, select a feature, zoom to it, and show the attributes in a Feature Info widget.

Use dark colors for code blocksCopy
1
https://experience.arcgis.com/experience/1979a38e105345749c57e203cf7e3eae/page/Santa-Monica-Parcel-Map#data_s=where%3Awidget_1-dataSource_1-1871234a785-layer-2%3Aain%3D%224281006900%22%2Cid%3AdataSource_1-18da94b061a-layer-2%3A13549&zoom_to_selection=true

The URL parameters do the following:

  • page/{pageId}: Opens the specified page in your experience.
  • #data_s=where:widget_1-dataSource_1-1871234a785-layer-2:ain="4281006900",id:dataSource_1-18da94b061a-layer-2:13549: Selects the feature based on the where clause ain="4281006900".
  • zoom_to_selection=true: Zooms the map to the selected feature.
Santa Monica Parcels demo app
Santa Monica Parcels demo app

Best practices

URL parameters can improve the usability and functionality of your ArcGIS Experience Builder web apps. These parameters should be used carefully to ensure a smooth user experience. Here are some best practices for using URL parameters:

  • Validate and sanitize parameter values

    Always validate and sanitize parameter values to prevent security vulnerabilities. For example, if you are using user input in a URL parameter, ensure it is properly encoded and validated. This prevents issues like cross-site scripting (XSS) attacks or SQL injection.

  • Combine parameters for advanced workflows

    You can combine multiple parameters to create complex workflows. This allows you to create deep links that provide users with a tailored experience. See Display selected feature info as an example. Not all combinations of parameters will work so be sure to test them.

  • Test URLs across browsers and devices

    Test your URLs across different browsers and devices to ensure they work as expected. Different browsers may handle URL parameters differently, so it's important to test thoroughly.

Tutorials

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.