AnsweredAssumed Answered

How to show field alias instead of field name in PopupTemplate

Question asked by sl5337 on Mar 20, 2018
Latest reply on Mar 22, 2018 by sl5337

I'm trying to use the out-of-the-box functionality for PopupTemplate but I'm struggling with how to show the field alias instead of the field name. I've tried two ways of creating the content for the popup: using a Javascript function to render the content and using a dynamically-generated fieldInfos object. 


1. The Javascript function is supplied three parameters: key, value and data. The key is the field name, the value is the field value, and data is a list of key-values for the entire layer.  The field alias is not available to this function.


2. All of the examples of using fieldInfos to define the content show the label as hard-coded. I realize the examples have to be kept simple but hard-coding the labels is not practical in my situation. I have dozens of layers,  each with 50 or more attributes. I need to dynamically create the content for the popup.


I see the query tasks being executed when I click on a feature and I see the fieldAlias object being returned. I just don't know how to access it within the popup template configuration.


Any help is greatly appreciated.