AnsweredAssumed Answered

infoTemplate if field is Null display "n/a"

Question asked by louchios on Jun 11, 2014
Latest reply on Jun 11, 2014 by louchios
Hi I have the following code that is very similar to the JS sample

Sometimes the CITY_NAME field will be null. When that occurs I would like it to say "n/a" rather than "Null." It shows up as "Null" capitalized.

 if (layerName === 'County_City_Py') {                   var CityCountyTemplate = new InfoTemplate("",                     "City: ${CITY_NAME} <br/> County: ${COUNTY} <br/> State: ${STATE_NAME}");        CityCountyTemplate.setTitle("Search Result")                   feature.setInfoTemplate(CityCountyTemplate);  }

I have tried a combination of if/then statements including:

if (${CITY_NAME} != null) {
   Unexpected token { error

if ("${CITY_NAME"} != null) {
  No error but doesn't work.

Thank you!