Select to view content in your preferred language

Using URL Parameters in ArcGIS Online

267
2
Jump to solution
11-18-2024 07:09 AM
jchadwich1
Emerging Contributor
 

I have a dashboard that is typically opened from a primary dashboard. The workflow is that a user filters for a single item on the primary dashboard, which provides them with a link to the sub-dashboard. I want to use URL parameters such that when, for example, the user selects itemID = 123, and is provided a link to the sub-dashboard, when they open the link, this second dashboard automatically filters for itemID=123, changing the map extent and only including that item in the list widget.

I've tried doing so according to what I've read at this link by adding filters to both the primary and sub dashboards. However, I can't figure out how to actually add the parameters to the end of the URL as outlined on this page. Is this possible in ArcGIS Online?

0 Kudos
1 Solution

Accepted Solutions
JenniferAcunto
Esri Regular Contributor

How are you providing the link? I'm assuming it will be via a List element. Just build the link in the list template, and use the field reference for the field used in your dashboard parameter. 

To create a hyperlink, just copy the link (w/ the field reference). Add your hyperlink text, highlight it, and click the link icon. Then paste your link into the box. You can then delete the original link.

JenniferAcunto_0-1731944616655.png

 

If you are using a field in your parameters that has spaces or special characters in it, you will need to use Arcade the encode the URL. 

var url = 'https://portalurl/apps/dashboards/df286b3e14f64960ba7c84e29451a98a#p2='

var field = UrlEncode($datapoint.Volcano_Name)

var url2 = Concatenate(url, field)

return {
  textColor: '',
  backgroundColor: '',
  separatorColor:'',
  selectionColor: '',
  selectionTextColor: '',
  attributes: {
    url2: url2
  }
}

 

This time, you would just reference the expression variable for your hyperlink.

JenniferAcunto_1-1731944862321.png

 

- Jen

View solution in original post

2 Replies
JenniferAcunto
Esri Regular Contributor

How are you providing the link? I'm assuming it will be via a List element. Just build the link in the list template, and use the field reference for the field used in your dashboard parameter. 

To create a hyperlink, just copy the link (w/ the field reference). Add your hyperlink text, highlight it, and click the link icon. Then paste your link into the box. You can then delete the original link.

JenniferAcunto_0-1731944616655.png

 

If you are using a field in your parameters that has spaces or special characters in it, you will need to use Arcade the encode the URL. 

var url = 'https://portalurl/apps/dashboards/df286b3e14f64960ba7c84e29451a98a#p2='

var field = UrlEncode($datapoint.Volcano_Name)

var url2 = Concatenate(url, field)

return {
  textColor: '',
  backgroundColor: '',
  separatorColor:'',
  selectionColor: '',
  selectionTextColor: '',
  attributes: {
    url2: url2
  }
}

 

This time, you would just reference the expression variable for your hyperlink.

JenniferAcunto_1-1731944862321.png

 

- Jen
jchadwich1
Emerging Contributor

You're correct, I am adding the links within the list widget. This looks like exactly what I was looking for, I'm going to test it out now.

0 Kudos