formatting URL in Arcade

5900
9
Jump to solution
06-27-2018 09:18 AM
by Anonymous User
Not applicable

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)
0 Kudos
1 Solution

Accepted Solutions
ChelseaRozek
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
ChelseaRozek
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.

by Anonymous User
Not applicable

thanks Chelsea.  It works like a charm!

0 Kudos
LeoLadefian3
New Contributor III

How do you do this in Arcade?

0 Kudos
XanderBakker
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.  

0 Kudos
LeoLadefian3
New Contributor III

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

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi leo.ladefian_brookhavenga ,

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

0 Kudos
ChelseaRozek
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?

0 Kudos
LeoLadefian3
New Contributor III

returns as a string

0 Kudos
ChelseaRozek
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?

0 Kudos