after
feature.attributes.layerName = result.layerName;
insert this
if (feature.attributes["Your field name"] == '0') {
feature.attributes["Your field name"] = 'No data';
}
I'm not sure if there will be data type mismatch, but this is the way...
As long as nothing else cares about the data type being mutated in this way further down the line, personally I think this is purely a output format question and should not change the underlying data.Besides, the custom format function should work, I have just modified one of the samples without any issues.@Dorothea - what's the actual issue you're seeing? e.g. is your function not being called? is it returning the wrong value? what's the scope of your code? etc.In terms of the method signature, it looks ok, apart from a little efficiency that you could gain from using the attribute's value that's been passed in i.e.
function calculateAcre(/*string*/attributeValue, /*string*/ attributeName, /*object*/ allAttributes){
return attributeValue!="0"?attributeValue:"Unknown";
}
Checking against the value being a string containing zero is ok I guess, since all attributes are sent back from Identify as strings.Just a couple of little questions on the side, is the acreage value being zero the only indicator that the value has not been supplied or is there something else you could use? Also is there a situation where an acreage of zero is perfectly valid i.e. it has been supplied by the Assessors Office and the value really is zero?