Accessing coded value domains from Feature Set

2299
2
06-25-2014 08:34 AM
BryanBlaisdell
New Contributor
Hopefully this is an easy question:

Is there a way to access coded value domains from a FeatureSet?  I am running a table with coded domains through QueryTask, and half-expected the domains to be accessible from the resulting FeatureSet object "field" property. 

However, when I run the Query and check my result properties for "fields," all I see is "name, type, alias, length".  Am I looking in the wrong place?  What is the best way to access a domain from a QueryTask result?

Thanks in advance!

Bryan
0 Kudos
2 Replies
BrandonVan_Horn
Occasional Contributor

This would be a good one to get answered. I am having the same problem.

0 Kudos
ReneRubalcava
Frequent Contributor

You can find that information in the fields property of the layer.

Each field will have a domain property associated with it and will look something like this.

{

  "name":"Enabled",

  "type":"esriFieldTypeSmallInteger",

  "alias":"Enabled",

  "domain":{

    "type":"codedValue",

    "name":"EnabledDomain",

    "codedValues":[

      {

        "name":"False",

        "code":0

      },

      {

        "name":"True",

        "code":1

      }

    ]

  }

}