AnsweredAssumed Answered

Get description in InfoTemplate

Question asked by jay.kapalczynski on Oct 31, 2018
Latest reply on Nov 5, 2018 by jay.kapalczynski

I have a Map Service that is returning the field shown below....just snipped out of the JSON file.

 

When I create my InfoTemplate and reference this "ITEM" field  it returns the CODE value and not the NAME value

How can I get it to return the NAME value instead...

 

   "name": "Item",
   "type": "esriFieldTypeString",
   "alias": "Item of Interest",
   "length": 50,
   "domain": {
    "type": "codedValue",
    "name": "Item",
    "codedValues": [
     {
      "name": "Bait Pile Other -",
      "code": "0"
     },
     {
      "name": "Corn Bait Pile",
      "code": "1"
     },
     {
      "name": "Duck Blind",
      "code": "2"
     },
     {
      "name": "Gate",
      "code": "3"
     },
     {
      "name": "Hunting Stand",
      "code": "4"
     },
     {
      "name": "My Truck",
      "code": "5"
     }
    ],
    "mergePolicy": "esriMPTDefaultValue",
    "splitPolicy": "esriSPTDefaultValue"
   }

 

// POINTS OF INTEREST
var infoTemplatePOI = new InfoTemplate();
     infoTemplatePOI.setTitle("POI - ${Case_}");
     infoTemplatePOI.setContent("<table>" +
     "<tr><td id='tblMainline1'>Item</td><td id='tblSubline2'>${Item}</td></tr>" +
     "</table><hr>");
var POIs = new FeatureLayer("https://xxx/arcgis/rest/services/Projects/MapServer/1", {
     mode: FeatureLayer.MODE_SNAPSHOT,
     id: "POI",
     opacity: .5,
     visible: false,
     outFields:["*"],
     infoTemplate: infoTemplatePOI
});
legendLayers.push({ layer: POIs, title: 'Points of Interest' });

Outcomes