AnsweredAssumed Answered

Coded Domain values when doing Query tasks

Question asked by namoraj96 on Oct 19, 2018
Latest reply on Oct 22, 2018 by rscheitlin

Hello Friends, i saw lots of discussions on coded Domain values when doing Query tasks. But not a single is useful for me yet. I am having same question as you explain here. Can you please help me with the same for 4.9 API.

I am having 2 attributes with coded values..I want to add a drop down menu to selecting values for that specific attribute. So user can select specific value of that attribute and perform query task.

Right now am using below function.. 

Thank you.

let Status = new Query({
   returnGeometry: false,
   where: '1=1',
   returnDistinctValues: true,
   outFields: ['STATUS']
});
qTask1.execute(Status).then(function(results) {
      results.features.map(function(feat) {
      let opt5 = document.createElement('option');
      opt5.value = feat.attributes.STATUS;
      opt5.innerHTML = feat.attributes.STATUS;
      stadd.appendChild(opt5);
});
view.graphic.add(selectedGraphics);
});

 

let qSubtype = new Query({
   returnGeometry: false,
   where: '1=1',
   returnDistinctValues: true,
   outFields: ['SUBTYPE']
});
qTask72.execute(qSubtype).then(function(results) {
      results.features.map(function(feat) {
      let opt3 = document.createElement('option');
      opt3.value = feat.attributes.SUBTYPE;
      opt3.innerHTML = feat.attributes.SUBTYPE;
      subdd.appendChild(opt3);
});
view.graphic.add(selectedGraphics);
});

Outcomes