Select to view content in your preferred language

URL hyperlink don't work in AGOL Dashboard

129
2
Jump to solution
Tuesday
KenBouchard
Regular Contributor

Hi folks!

I’m working on adding a hyperlink to a table in an ArcGIS Dashboard.
 
Below is the Arcade expression I’ve been using, based on ESRI’s How-to guide:

 

    URL: {

      displayText: `<a href="${$datapoint["URL"]}" target="blank">${$datapoint["URL"]}</a>`,
      hoverText: `<a href="${$datapoint["URL"]}" target="blank">${$datapoint["URL"]}</a>`,
      textColor: '',
      backgroundColor: '',
      textAlign: 'left',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },

 

However, look at the screenshot.  The hover text matches the display text in the code, but at the bottom of the page of the browser it shows the link of my dashboard. When I click the hyperlink, it just reloads the same dashboard.

Doesn't make sense to me!  Somebody have any ideas?

Ken

 

KenBouchard_0-1765286279836.png

 

0 Kudos
1 Solution

Accepted Solutions
Neal_t_k
Frequent Contributor

Your URL doesn't have the proper formatting.  "www.nhl.com"  vs "https://www.nhl.com/"

edit:

If you can't amend the underlying data, maybe something like this will work:

var URL = Concatenate("https://",$datapoint.URL)
var URL1 = Concatenate('<a href=',URL,' target="blank">',$datapoint.URL,'</a>')
 
 return{
...
      displayText : Text(URL1),
 ...

 

View solution in original post

2 Replies
Neal_t_k
Frequent Contributor

Your URL doesn't have the proper formatting.  "www.nhl.com"  vs "https://www.nhl.com/"

edit:

If you can't amend the underlying data, maybe something like this will work:

var URL = Concatenate("https://",$datapoint.URL)
var URL1 = Concatenate('<a href=',URL,' target="blank">',$datapoint.URL,'</a>')
 
 return{
...
      displayText : Text(URL1),
 ...

 

KenBouchard
Regular Contributor

It worked!  Thanks

0 Kudos