Dynamic URL to image in List widget

782
7
Jump to solution
05-25-2021 09:55 AM
VHolubec
Esri Regular Contributor

Hello,

in ExB I have a list widget which uses a data from table layer.

I need to set a image for each item in a list based on combination of fix url, and the attribute of the feature - which changes in time. Is there a way to do so? 

It seems, that Arcade expressions are not supported / even it would be a best option there - to use something like:

"https://server.domain.com/images/" + {attribute} + ".png" 

On a list I see for the image url just an attribute and function - none of them does not handle the example above.

Have someone know if there is any other way I missed? 

Thank you.

Vladimir

0 Kudos
1 Solution

Accepted Solutions
BrunoSousa1
New Contributor III

Hi @VHolubec 

This is an expression that's working for me on the Beirut Recovery App:
BrunoSousa1_0-1621965144540.png


Do you mind sharing a URL to an image in your table? I'm curious as why it's not working

View solution in original post

7 Replies
BrunoSousa1
New Contributor III

Hi

Not sure if you're doing this but your expression should look like: "https://server.domain.com/images/"+{attribute}+".png" 

You can also have the whole URL as an attribute in the table, so you would only need to use the attribute instead of an expression if that's not working for you.

You can see this working on my apps:
Beirut Recovery Map 
Perseverance Rover 

0 Kudos
VHolubec
Esri Regular Contributor

Hi @BrunoSousa1 

you are right, I just forgot the + marks there, but yes, with + marks it works fine in Arcade (I fixed this in original post).

Anyway, the static url attribute is not the option I am seeking for.

The attribute is related to state of water quality, and {attribute} can change quite often during the time (the values coming from domain), and the url attribute would be a one more attribute to maintain, which can raise more errors in data - anyway if there wouldn´t be any other change this is the last possible workaround.

Vladimir

P.S. very nice apps! Thank you for links.

 

0 Kudos
BrunoSousa1
New Contributor III

Hi @VHolubec 

This is an expression that's working for me on the Beirut Recovery App:
BrunoSousa1_0-1621965144540.png


Do you mind sharing a URL to an image in your table? I'm curious as why it's not working

View solution in original post

VHolubec
Esri Regular Contributor

Hi, @BrunoSousa1,

it's awkward, I am sorry. I had there a wrongly quotation marks. The screenshot has helped me a lot.

Thank you so much!

Vladimir

GeertOffenberg1
New Contributor II

Hi all, 

I have a similar issue in where ArcGIS Experience does not fetch the image of an url I added in the data in a List Widget, see image below.

GeertOffenberg1_0-1622056179491.png

I tried replacing 'https' to 'http', but this did not help either. It is not a link that is made with an expression. (i.e. this image ). 

So, it is not the exact problem as asked above, but a very similar one I guess. Could somebody steer me in the right direction or do you perhaps know it @BrunoSousa1 ? 

Thanks!

Geert

0 Kudos
BrunoSousa1
New Contributor III

HI @GeertOffenberg1 ,

I added the URL of the image you mentioned to a table and tried it on a list widget and the imaged loaded. 

You have the full image URLs within your table, right? They should work right away when you connect the List widget to the data/layer and choose the column/attribute that stores the full URL for each image.

Try again with the Chrome Developer Tools (F12) open on Console to see what error messages it shows.

0 Kudos
GeertOffenberg1
New Contributor II

Hi @BrunoSousa1

I tested it with a different layer file and saw I used the wrong column this whole time!! I appreciate your time in answering my question!