Select to view content in your preferred language

Conditionally Set a Graphic or Color In The List Widget

2199
6
10-18-2022 04:25 AM
GregReinecke
Occasional Contributor

Hello ,

I continue to work through use of the ExB List widget. In my case I have a single data source where features have a field named "Status" and the value can be Good, Marginal or Bad. When I create the list I can assign a single image to the left, assign dynamic text in the center and assign a button to the right. These seemingly are great options but don't support my need to differentiate one items value from the other.  

My initial thought was to use some type of expression to choose an image based on a condition like below. 

List.png

I haven't seen a place to put a conditional statement. Ultimately, I'd like to simply just differentiate one item type from the others visually in the list. Perhaps a different color background, or button color, etc. 

Any suggestions would be really helpful. Thanks in advance,

GR

0 Kudos
6 Replies
DanielMiranda2
Occasional Contributor

Image widgets that are part of lists can be dynamic. You have to connect it to data in the image content tab (I connected mine to a MapBoundariesComplete feature layer):

DanielMiranda2_0-1666110289524.png

 

It might get a bit messy from here, but two ways to handle this:

 

1. Use URL. Host your red, yellow, and green images on the web. Then, create an attribute in your data to store the URL, pointing the correct image based on status. Finally, use URL in Experience Builder and set it to that field.

 

2. Attach the images directly to your data and use auto-populated attachment.

 

I think #1 would be easier to keep up to date, changing a text string URL is probably easier than adding/removing attachments. But, if you cannot easily host an image somewhere, and the status does not change often, it could be a better option.

 

There may be other ways to do this, but hopefully this helps!

Teresa_Blader
Occasional Contributor III

Thanks for the tip! In the same line as point 1... I used URL, with Expression, but wrote an expression that would modify the URL based on the field, and then named the corresponding images stored on our arcgis image server based on the domain structure. No attribute field adding needed!

Teresa_Blader_1-1678220777922.png

 

 

Teresa Blader
Olmsted County GIS Specialist
EstherEliasson
New Contributor II

Thank you for this, great tip!

0 Kudos
AaronPDXPaul
New Contributor III

I want to do something similar, and very basic. But I don't see how either of you are using conditional logic.

I want an image to change based on Evacuation Status.

1. Evacuating

2. Evacuated

3. Not Leaving

How can I change the List based on Evacuation Status?

Alternatively, the text in the List could change instead.

But this seems to be a feature in Dashboards, conditional formatting.

Lastly, another field has text like "High Priority",

If this field has the text "High Priority" in it.

Can it change the image and/or Text?

Thank you,

Aaron

RobertAnderson3
MVP Regular Contributor

I came across the post looking to do something similar, on our shortlist app we change the image to have a checkmark over it if the project is complete by changing the URL it points to. This can still be done within our data simple enough as I create the new ExB but when we have a field for Status I was hoping this type of thing would be possible.

If {STATUS} = 100, use "Checkmark.jpg" else use URL Image. 

RobertAnderson3_0-1697649303375.png

They're all hosted already, just trying to save a step for whoever ends up responsible for the updates.

EmmaCurran18
New Contributor II

Looking for a similar resolution for being able to apply conditional statements in Experience Builder, directly to a dataset, to selected features, or to the output of another widget (like Near Me).

0 Kudos