if (!IsEmpty($feature.scientificname) && !IsEmpty($feature.survey_area)) {
var sciName = $feature.scientificname
var surveyArea = $feature.survey_area
var priorityTable = FeatureSetById($map, "my_table_ID_#");
var filtered = Filter(priorityTable, "botanical_name = @sciName AND zone = @surveyArea");
if (!IsEmpty(filtered)) {
return First(filtered).apa_priority
} else {
return "no cat found"
}
} else {
return "uncat"
}
Solved! Go to Solution.
My only guess then is the AND in the filter as I can find no examples of this. Do a test without the and just to see.
Hi @DougBrowning ,
Thanks for your suggestions!
ESRI support figured out a work around:
Move the First() to line 7 instead of 9 like so:
var filtered = First(Filter(priorityTable, "botanical_name = @sciName AND zone = @surveyArea"));
They unfortunately couldn't figure out why this code worked as opposed to the other code.
Hope this helps someone in the future...
Have you tried FeatureSetByName instead? It can get picky. Also the table is in the map right?
Hi @DougBrowning thanks for your reply.
Yes, I have tried FeatureSetByName, and it definitely is in the Web Map, I can see it in the arcade profile variables, as well as in the layers/tables list in Field Maps Designer. I've also been able to replicate the code in the Arcade Playground by making the table shared public. Still no luck.
The table is not part of the Feature Layer (hosted), but is part of the Web Map, that's the only other thing I can think of now.
My only guess then is the AND in the filter as I can find no examples of this. Do a test without the and just to see.
Hi @DougBrowning ,
Thanks for your suggestions!
ESRI support figured out a work around:
Move the First() to line 7 instead of 9 like so:
var filtered = First(Filter(priorityTable, "botanical_name = @sciName AND zone = @surveyArea"));
They unfortunately couldn't figure out why this code worked as opposed to the other code.
Hope this helps someone in the future...