I am configuring a map in ArcGIS Online that includes a Workforce Assignments layer. In the map pop-ups I would like to convert some of the Guid fields (workerid, assignmenttype) into a readable format. I have tried the following Arcade expressions without success:
if ($feature.workerid == "{97dfbbb5-dd72-47ba-8696-b7ca9f546171}"){
return "Sarah"}
if (Guid($feature.workerid) == "97dfbbb5-dd72-47ba-8696-b7ca9f546171"){
return "Sarah"
}
The new Worker Name field doesn't populate.
How can this be accomplished?
Solved! Go to Solution.
there does not appear to be curly brackets in the field for workerid.
All of these work for me:
if ($feature.workerid == "97dfbbb5-dd72-47ba-8696-b7ca9f546171"){
return "Sarah"}
or, can be handled with Decode. Might be easier depending on how many workers you have:
Decode($feature.workerid, "e4e30100-aaf1-4567-bc6f-2393b779e367", "Sarah",
"esf30100-aaf1-4567-bc6f-239sfd45874", "George", $feature.workerid)
or using When:
When($feature.workerid == "e4e30100-aaf1-4567-bc6f-2393b779e367","Sarah",
$feature.workerid == "e4e30100-aaf1-4567-bc6f-2393b779e367","George", "Other")
R_
@Anonymous User can you try:
there does not appear to be curly brackets in the field for workerid.
All of these work for me:
if ($feature.workerid == "97dfbbb5-dd72-47ba-8696-b7ca9f546171"){
return "Sarah"}
or, can be handled with Decode. Might be easier depending on how many workers you have:
Decode($feature.workerid, "e4e30100-aaf1-4567-bc6f-2393b779e367", "Sarah",
"esf30100-aaf1-4567-bc6f-239sfd45874", "George", $feature.workerid)
or using When:
When($feature.workerid == "e4e30100-aaf1-4567-bc6f-2393b779e367","Sarah",
$feature.workerid == "e4e30100-aaf1-4567-bc6f-2393b779e367","George", "Other")
R_