Select to view content in your preferred language

Help with Arcade Expression for text Colour in popup

451
4
Jump to solution
11-22-2024 09:03 AM
aam
by
Frequent Contributor

I have the following arcade expression that returns value based on conditions set. I want to modify this expression so that if Eligible I want to show the return message in Green. And if not eligible I would like the message to be in Red.

How can I do that?

 

if ($feature.Eligibility == 'Eligible'){
    return 'Please Fill out the required information'
}

else if ($feature.Eligibility == 'Not Eligible'){
    return $feature.TrafficStudyStatus
}
0 Kudos
1 Solution

Accepted Solutions
SteveCole
Honored Contributor
4 Replies
SteveCole
Honored Contributor

Take a look at this ESRI Blog Post.

aam
by
Frequent Contributor

Thank you!

0 Kudos
aam
by
Frequent Contributor

I actually have one more question. How can I make this expression in a way that the last condition does not show anything in the popup. I've tried using return none and NULL but its not working.

if ($feature.TrafficStudyStatus == 'Not a Town Owned Road'){
    return '#ffa77f'
}

else if ($feature.TrafficStudyStatus == 'Study Initiated'){
    return '#0070ff'
}

else if ($feature.TrafficStudyStatus == 'Non-Physical Measures to be Implemented'){
    return '#9e559c'
}

else if ($feature.TrafficStudyStatus == 'Eligible for Traffic Calming Request'){
    return NULL
}
0 Kudos
aam
by
Frequent Contributor

Sorry never mind I figured it out.

0 Kudos