Use hex codes in if/else statement using Arcade

2239
3
Jump to solution
06-10-2021 11:13 AM
Hannah_Hutchins
New Contributor

I have a custom pop-up where I'm using HTML and Arcade expressions to communicate whether or not a Library was included in an event. I have a large table built in the pop-up using HTML (see "HTML.txt") and inside that table, I have Arcade expressions using if/else statements to return an "X" if the result is true (or the Library was involved). I'm using a "1" in the attribute table indicating that a Library was involved and a "0" if they were not involved.

Here is an example of one arcade expression (titled: {expression/expr0}) which I then bring into the table HTML code (I have one arcade expression for each Library - probably not efficient, but I'm new to arcade!):

var X = $feature["Augsburg_Park"];
IIf (X == 1, 'X', '');

This results in a pop-up that looks like this:

Hannah_Hutchins_0-1623348488521.png

Here is where I need help!

If a Library has an "X" in the table next to it (meaning it was included in an event), I would like to have the text (Library name and the "X") bolded and change colors (#00AEEF).

How do I integrate hex codes and font changes into an arcade expression?

0 Kudos
1 Solution

Accepted Solutions
3 Replies
MarkBockenhauer
Esri Regular Contributor
SarahRijneke
Frequent Contributor

Can this be achieved in ArcPro?

0 Kudos
edward33
Regular Contributor

This way listed above will not work. If you wish to do it in ArcPro follow this:

For hex values: #eb4034

For rgb values: rgb(123,45,67)

Example expression using hex with when statements and Arcade:

arcade_hexcodes.PNG

0 Kudos