Select Query returns Coded value for domain not description/name

156
2
Jump to solution
01-23-2019 02:36 AM
MuhammadFayaz
Occasional Contributor

Hello,

i have a select query which return a feature with coded value in "selectFeature.attributes.feildName" for the domain, But we need the name/description NOT coded value.

selectQuery.geometry = evt.mapPoint;
selectQuery.distance = 5;
selectQuery.units = "meters"
selectQuery.returnGeometry = true;
Parcels.selectFeatures(selectQuery, FeatureLayer.SELECTION_NEW, function (features) {
if (features.length > 0) {
updateFeature = features[0];
map.infoWindow.setTitle(features[0].getLayer().name);
map.infoWindow.show(evt.screenPoint, map.getInfoWindowAnchor(evt.screenPoint));
}
else {
map.infoWindow.hide();
}
});
});

How can i replace the coded domain value with the description in "updateFeature.attributes" in above code?

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

Muhammad,

   You have to get the description using the fields domain.

var fldDomain = Parcels.getDomain("fieldName");
var desc = fldDomain.getName(selectFeature.attributes.fieldName);

View solution in original post

2 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Muhammad,

   You have to get the description using the fields domain.

var fldDomain = Parcels.getDomain("fieldName");
var desc = fldDomain.getName(selectFeature.attributes.fieldName);

View solution in original post

MuhammadFayaz
Occasional Contributor

Thank you,

That is working!

0 Kudos