formatting URL in Arcade

737
9
Jump to solution
06-27-2018 09:18 AM
Highlighted
New Contributor III

I have  two values, $feature.Address , $feature["URL_1"]); I would like the popup window to show the address and when the user clicks on address it goes to the url

$feature.Address 

Is there a way to do this?

Tags (1)
Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
MVP Regular Contributor

Hi Jorge,

    If I'm understanding your question correctly, you don't need Arcade for this. Simply set up the popup as shown in the image below. Put the names of your fields between the { }. You must have the {ADDRESS} part in the popup editor selected before you configure the link properties.

View solution in original post

9 Replies
Highlighted
MVP Regular Contributor

Hi Jorge,

    If I'm understanding your question correctly, you don't need Arcade for this. Simply set up the popup as shown in the image below. Put the names of your fields between the { }. You must have the {ADDRESS} part in the popup editor selected before you configure the link properties.

View solution in original post

Highlighted
New Contributor III

thanks Chelsea.  It works like a charm!

Reply
0 Kudos
Highlighted
New Contributor II

How do you do this in Arcade?

Reply
0 Kudos
Highlighted
Esri Esteemed Contributor

Hi Leo Ladefian ,

Can you elaborate about what you want to accomplish and why the solution provided by Chelsea does not work for you? Chelsea showed how you can do this without Arcade and creating Arcade expressions that will just return the field value does not make much sense.  

Reply
0 Kudos
Highlighted
New Contributor II

I do not want to create a custom attribute display, all of my data are in fields.  I'm not just returning the field value, it's a concatenated value from two fields.  One is a hyperlink and the other is a text field.  When they are combined with arcade they cease to be a hyperlink in the popup.

$feature.hyperlink + $feature.parcelid

Reply
0 Kudos
Highlighted
Esri Esteemed Contributor

Hi leo.ladefian_brookhavenga ,

Have you tried using "{hyperlink}{parcelid}" (without the quotes) in the URL field of the interface?

Reply
0 Kudos
Highlighted
MVP Regular Contributor

Hi Leo Ladefian‌, I tried doing the same thing and it seems to work for me. Let me know where I'm deviating from what you're doing.

Attributes: (strings)

firstpart = "https://www.google.com/maps/search/?api=1"

secondpart = "&query=centurylink+field"

custom arcade expression = return $feature.firstpart + $feature.secondpart

The arcade expression is the highlighted one and is appearing as a link for me in Map Viewer (not beta).

Can you provide an example of attributes you're using? Are you trying to use the Arcade in an app aside from Map Viewer?

Reply
0 Kudos
Highlighted
New Contributor II

returns as a string

Reply
0 Kudos
Highlighted
MVP Regular Contributor

It is a string. "Hyperlink" isn't a field type. Just date, double, integer, string in AGO: Add or delete a field—ArcGIS Online Help | Documentation 

You may have had it set up to look like a hyperlink in ArcMap, but it is just a text/string field told to display like a hyperlink: Using Hyperlinks—Help | ArcGIS Desktop 

What matters is how apps display that string. How does it appear in the actual popup in AGO?

Reply
0 Kudos