Arcade Expression in Image Popup

1342
2
Jump to solution
12-05-2018 07:41 AM
LorneDmitruk2
New Contributor III

Hi,

I'm trying to a simple expression in Arcade to populate the image portion of a popup. I have two fields in my data containing the google drive location of the image and its thumbnail. I use the following to test if an image exists for record:

 return IIF(isEmpty($feature.Picture), "", $feature.Picture)

and the popup is configure as follows:

 Popup Media Configuration

This works as expected when there is no image available.

No image for feature

However when there is an image the following happens: 

Popup with image

When I checked the response it turns out Arcade is trashing the URL from the field. So instead of sending 

https://drive.google.com/foo/b.ar/uc?export=view&id=1qLYMclQ5nDGYaM895ziF-5EzD4Am385-

The following is sent:

https://drive.google.com/foo/b.ar/uc?export=view&id=1qLYMclQ5nDGYaM895ziF-5EzD4Am385-

Notice how & got changed to &. This ends up causing the GET request for the image to fail/

Accessing the images by just passing the field into the popup works fine, but I'd rather test for the existence and only provide the link and thumbnail if there is one. Any thoughts on why this is happening and how to prevent it?

Cheers

0 Kudos
1 Solution

Accepted Solutions
JakeSkinner
Esri Esteemed Contributor

Hi Lorne,

I believe you will receive the results you need by just passing the field for the Image.  Here is an example of a pop-up with no URL in the field:

Here is a pop-up that contains a URL:

View solution in original post

2 Replies
JakeSkinner
Esri Esteemed Contributor

Hi Lorne,

I believe you will receive the results you need by just passing the field for the Image.  Here is an example of a pop-up with no URL in the field:

Here is a pop-up that contains a URL:

LorneDmitruk2
New Contributor III

That does the trick

0 Kudos