I need to parse a string out of a featurelayer field to create a label, can anyone point me to a solution. The labelExpressionInfo looks like the following;
var HYjson = {
labelExpressionInfo:{
expression: "$feature.link"
}
};
what I need to do would be something that accomplishes what would be a substr(-5) on the expression.
For Label Expressions, you can use the Arcade format. In Arcade to get a part of the string we use below expression.
var expression = "mid($feature.LABELFIELD, 2, 3)";
here you get the characters from 3 to 5.
This link is not for JS api but, contains lot of tip on how to use Arcade.Specify text for labels—ArcGIS Pro | ArcGIS Desktop