query.OutFields.AddRange(new string[] { "FIELD_NAME" });
You can set your query's OutFields property so that it will return only the fields that you want it to return.query.OutFields.AddRange(new string[] { "FIELD_NAME" });
Do you mean this?
In this feature service http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/FeatureServer...
ftype is CodedValueDomain, each number represent a category that can be one of the following values (Hydro-Meteorlogical, Public Health, ... Vehicle)
If I want to see only features that are "Vehicle", my query's Where is "ftype = 10801"
foreach (Field field in fl.LayerInfo.Fields)
{
if (field.Domain is CodedValueDomain)
{
CodedValueDomain domain = field.Domain as CodedValueDomain;
foreach (var item in domain.CodedValues)
{
//item.Key is an object this is what you need in your query
}
}
}
I think what you can do is first know the groups, which you can do by:foreach (Field field in fl.LayerInfo.Fields) { if (field.Domain is CodedValueDomain) { CodedValueDomain domain = field.Domain as CodedValueDomain; foreach (var item in domain.CodedValues) { //item.Key is an object this is what you need in your query } } }
If your FeatureLayer was HomelandSecurity as in my previous post, you can see that ftype is CodedValueDomain and you can perform your query where "ftype = 10801".