Select to view content in your preferred language

Pro Hyperlink breaks with special characters

2851
17
Jump to solution
11-27-2019 07:07 AM
MatthewDriscoll
MVP Alum

We have paths and file names with special characters:  L:\Path\MATT'S ADDN BLK 1,2,&3.TIF.  I know this is a terrible thing to do, but it was done long ago before my time here.  My guess is it is due to the special characters.

The paths are stored in an attribute and I am using that as a hyperlink in a custom popup.  The ones which do not have special characters of course open fine.  But I get the following error below on the ones that do. Hitting Yes does nothing.

This is not a problem in using the ArcMap hyperlink (lighting bolt).

   

arcmap equivalency‌ arcmap equivalent

0 Kudos
17 Replies
XanderBakker
Esri Esteemed Contributor

Hi Matthew Driscoll ,

I think I'm going to have to disagree with customer support. If in the same pop-up using the same Arcade expression an image is visualized correctly, but the link to open the same image is resulting in an error, this cannot be something caused by the Arcade expression, but is something that ArcGIS Pro is doing with the result of the expression. 

CC Kory Kramer‌ what do you think?

Arcade is the expression language Esri has chosen to implement as the cross platform expression language for all the profiles below (and this list is growing).

KoryKramer
Esri Community Moderator

Hey Xander Bakker‌ 

I think Mark Bockenhauer‌ got at this above when he said "I tried using Arcade to workaround the link issue, and I think internal Popup window code is interfering.  I have raised this with the team that works on Popups."  That dev team has entered an internal issue to look into this.

XanderBakker
Esri Esteemed Contributor
MatthewDriscoll
MVP Alum

Thanks Xander.  I have just been getting started with using Arcade on different platforms.  I have seen some amazing things others have done with Arcade expressions, I can't wait to dive in deeper.  

XanderBakker
Esri Esteemed Contributor

Hi Matthew Driscoll  and Dan Patterson ,

I just did a little test and although I have the same issue with the link, the image does show in the pop-up (using the original path without any encoding). However, when you click on the image or the link, it will produce the error. I tried to use the UrlEncode function in Arcade (as you can see at the wonderful text next to "CreateHyperlink", but this does not work either. I even include the "file:///" before the path and that did not work either. 

Kory Kramer‌; do you know how to avoid the error message?

Here is the error message (in Spanish)

MatthewDriscoll
MVP Alum

Testing this more I found the path works fine within the popup.  But still cannot figure out a way to hyperlink correctly.

  

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi Matthew Driscoll ,

The image tag with the file link will work and display the image, but when using the same link in the href of an anchor it fails. So IMHO something that needs fixing in ArcGIS Pro. See code below:

var file = Replace($feature.Plat_HL, "'", "%27");
file = Replace(file, "&", "%26");
file = Replace(file, " ", "%20");
file = Replace(file, ",", "%2C");

return '<a href="file:///' + file + '"><img src="file:///' + file + '" width="250"></a>';

Which leads to showing the image in the pop-up...

.. but clicking on it will fail:

MatthewDriscoll
MVP Alum

 BUG-000127258

0 Kudos