I have a field that has numbers and zeros. I want to label the the numbers as is but the zeros need to label as the word "pending". I know the start of the code is $feature(AADT_2020_Label) which will label the number. How do I make the expression if AADT_2020_Label equals zero label as pending? I've tried just putting pending in the text field but for some reason it is not liking it.
Solved! Go to Solution.
There's still an open parentheses in the return feature with no closed parentheses. I took it out and it seems to be working. Thank you.
if ( $feature(["AADT_2020_Label"] > 0) {
return $feature(["AADT_2020_Label"]
}
else {
return "Pending"
}
if ($feature(["AADT_2020_LBL"] > 0) {return $feature(["AADT_2020_LBL"]} else {return "Pending"}
I think there needs to be closed parentheses. I am getting the error of Parse Error:Line 1: Unexpected token {
sure:
if ($feature["AADT_2020_LBL"] > 0) {return $feature(["AADT_2020_LBL"]} else {return "Pending"}
There's still an open parentheses in the return feature with no closed parentheses. I took it out and it seems to be working. Thank you.
You're going to set the removal of an inadvertent parenthesis in the code I provided as the solution? 🙄