Hi all,
I am quite new to arcade so forgive me if the answer is way too obvious to everyone...
I'm trying to use arcade to change the symbology so it displays two different fields, each one with its own domain.
The fields are cleanseStatus and cycle. Both have a domain as well
I have used the expression:
($feature.cleanseStatus) + "," + ($feature.cycle)
But I only get the code for the cleanse status, and nothing for the cycle and also get the code for the different cleanseStatus and not the description.
Ideally I would like to see the cleanse status code description, then a coma, and then the cycle code description so I can adjust the symbology for each one independently.
Thanks a lot in advance.
Albert
Quick update.
By using the following expression I get the code for each field, but not the description..
DomainName($feature,"cleanseStatus") + ',' + DomainName($feature,"cycle")
@HalaAbdelmaksoud has what ought to be the solution here, but it's odd that it wouldn't work for your data.
My only suggestion in addition to that would be to use a backtick string and some variables to help keep the code a bit clearer.
Try this expression and click Test in the expression builder, then see what the Messages tab shows you.
var status = DomainName($feature, 'cleanseStatus')
var cycle = DomainName($feature, 'cycle')
// Send variables to console to check their values
Console(status)
Console(cycle)
// Return formatted string
return `${status}, ${cycle}`
I get this error
"Parse Error:Line 9: Unexpected token ILLEGAL"
Did you get anything in the messages tab?
Also, where is this data coming from? Is it possible that the source portal is at a lower version with fewer capabilities in Arcade?
I have tried this way: DomainName($feature,"Field1") + "," + DomainName($feature,"Field2") but with my data, and it works well.