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

  • In which way is my updated answer still not working for you? – Stefan Dec 13 '18 at 15:58
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

  • I had A List of Field Attributes selected, but I just changed it to Custom Attribute Display and it still returns the raw HTML – AvidDabbler Dec 11 '18 at 20:11
  • See my edit above. – Stefan Dec 11 '18 at 20:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.