AnsweredAssumed Answered

Can you evaluate Arcade expressions in MapImageLayer popups?

Question asked by nrindlaub on Jun 27, 2018
Latest reply on Jul 3, 2018 by nrindlaub

Hi all - 

 

I'm having trouble getting a popup for a MapImageLayer sublayer to evaluate an arcade expression I set in the expressionInfos property of the popup template. It works fine if I load the layer as a FeatureLayer, but it does not seem to work if I load it as a MapImage Layer. Does that popupTemplate feature simply not work for MapImageLayers?

 

My popupTemplate is below: 

 

 

popupTemplate: {
   title: 'Other Tracts',
   content:
      '<ul><li><strong>Tract Name:</strong> {TRACTNAME}</li>' +
      '<li class=\'{expression/check-othername}\'><strong>Other Name:</strong> {OTHERNAME}</li>' +
      '<li><strong>Conservation Priority:</strong> {TIER}</li>' +
      '<li><strong>Site Name:</strong> {SITENAME}</li>' +
      '<li><strong>Plan Name:</strong> {PLANNAME}</li>' +
      '<li><strong>Plan URL:</strong> {PLANURL}</li>' +
      '<li><strong>Comments:</strong> {COMMENTS}</li>',
   fieldInfos: [{
      fieldName: 'PROTDATE',
      format: {
         dateFormat: 'short-date'
      }
   }],
   expressionInfos: [{
      name: 'check-othername',
      expression: "if($feature.OTHERNAME == NULL){return 'invisible'}"
   }]
}

Outcomes