2

I have a layer with a "Completed" field with 4 unique values. - design phase - future year - under construction - completed

in my pop-up configs I have "Status: {Completed}"

How can I use Arcade to change the color of the status value text based on its value?

eg. completed = green under construction = orange, design phase black future years light grey

3 Answers 3

5

The Answer was to create a specific Arcade Expression per "Value" that I wanted and identify each expression in the pop-up config with a different color text.

Expression 0: IIf($feature.status=='completed', 'completed', '')

Expression 1: IIf($feature.status=='under construction’, 'under construction', '') Expression 2: IIf($feature.status=='in design', 'in design', '')

Add each expression in pop-up

Status: {expression/expr0}{expression/expr1}{expression/exp2}

assign each of those expression a unique color within the pop-up config manager

1

One slight difference I used was in passing the field value back into the expression, rather than defining it as 'string':

IIf($feature.status=='under construction’, $feature.status, '')
IIf($feature.status=='completed’, $feature.status, '')
IIf($feature.status=='in design’, $feature.status, '')

This works really well for non-string values as well, ex. $feature.speed>50, $feature.speed<60.

0

Check this out

Bring Colors From Your Map Into Your Pop-up Using Arcade

https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/bring-colors-from-your-map-into-your-pop-up-using-arcade/

2
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Sep 30, 2021 at 22:16
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
    – Vince
    Sep 30, 2021 at 22:37

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.