1

I am working on creating a hyperlink by configuring the popup through Attribute Expressions. The purpose is to create a telephone call link for all of the Municipalites. I have all of the numbers for all of the police departments and want to insert them into some HTML text which will be populated by creating a virtual field in Attribute Expressions.

When I have the full HTML in the field, the hyperlink is created, but when I write out the code by using Attribute Expressions below the HTML text just shows up with no link.

I would prefer to keep using a list of attributes instead of a custom display as I think this looks more professional, and would like to populate the HTML code as apposed to changing the HTML every time so that people more involved with the call center activities can make changes to the phone numbers.

var phone = $feature.Police_Num1
'<a href="tel:91' + phone + '">' + phone + '</a>'

Has anyone else had this issue or know how to solve for it?

UPDATED

enter image description here enter image description here

asked Dec 11, 2018 at 15:39
1
  • In which way is my updated answer still not working for you? Commented Dec 13, 2018 at 15:58

1 Answer 1

1

Make sure that you are using a custom attribute display rather than Attribute Expressions. You will still be able to use attribute expressions there.

See the related ESRI documentation for more information.

Edit: You need to toggle "HTML source" (it is the first symbol in the second row of toolbar buttons, see screenshot below).

Screenshot of ArcGIS Online Popup > Custom Attribute Display in German

Toggling "HTML source" back immediately renders the correct output:

Screenshot of ArcGIS Online Popup > Custom Attribute Display in German with rendered HTML

answered Dec 11, 2018 at 16:56
2
  • I had A List of Field Attributes selected, but I just changed it to Custom Attribute Display and it still returns the raw HTML Commented Dec 11, 2018 at 20:11
  • See my edit above. Commented Dec 11, 2018 at 20:31

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.