Dear Xander,
I have tried your code for something similar. The code tests ok, but when I hit 'Done', I get a message that says 'WARNING. the expression must return a number value'. But its a text field?
I am applying the expression to a layer style (hosted feature service) so i can get a unique symbology (originally, the values were controlled by a domain but now its free text so I have to use code to classify the various inputs). Code is:
//RWW reproductive status.
//Group by flowering, or not flowering
//6 classes
var Repro = $feature.REPRSTATUS;
if (Find("Flowering",Repro,0)>0) {
return "Flowering"}
else if (Find("Non",Repro,0)>0) {
return "Non flowering"}
else if (Find("Veg",Repro,0)>0) {
return "Non flowering"}
else if (Find("Immature",Repro,0)>0) {
return "Non flowering"}
else if (Find("Seed",Repro,0)>0) {
return "Seeding"}
else {
return "Not recorded"
}
Any help would be appreciated:)