AnsweredAssumed Answered

Related table field in a popupTemplate function?

Question asked by JJhill on Feb 14, 2019
Latest reply on Aug 20, 2019 by JJhill

I cannot figure out how to call the related field using this function to populate the content of the popup. I have tried relationships/0/FieldName everywhere I thought it was necessary with no luck. I think I need to call fieldInfos within the content syntax, Correct?

 

 

            liquefactionPopup = function(value, key, data) {
                var content = "";

                if (key === "LQSHazardUnit") {
                    if (data.LQSHazardUnit) {
                        content += "<span class='bold' title='Magnitude'><b>LQSHazardUnit: </b></span>" + data.LQSHazardUnit + "<br/>";
                    }
                }
                if (key === "LQSMappedScale") {
                    if (data.LQSMappedScale) {
                        content += "<span class='bold' title='Longitude'><b>LQSMappedScale: </b></span>" + data.LQSMappedScale + "<br/>";
                    }
                }
}
                return content;
            }


            const liquefaction = new FeatureLayer({
                url: "https://services.arcgis.com/3",
                title: "Liquefaction Susceptibility",
                visible: false,
                outFields: ["*"],
                popupTemplate: {
                    title: "Liquefaction Susceptibility",
                    content: "{LQSHazardUnit:liquefactionPopup}{LQSMappedScale:liquefactionPopup}"
                },
            });

Outcomes