Hello ESRI Community,
I hope this message finds you well. I'm currently facing an issue with the JavaScript API for ArcGIS 4.24 while attempting to display the "Name_en" attribute in a PopupTemplate without underscores. Despite trying various approaches, the field's content is not being displayed as expected.
Here is a snippet of my current code:
let poptemp;
poptemp = new PopupTemplate({
title: "{Name}",
content: [{
type: "fields",
fieldInfos: [
{
fieldName: "Name_ar",
label: "Name_ar"
},
{
fieldName: "Name_en".replace(/_/g, ''),
label: "Name_en"
},
{
fieldName: "Wiki_ar_link",
label: "Wiki_ar_link"
},
{
fieldName: "Wiki_en_link",
label: "Wiki_en_link"
}
]
}]
});
I have attempted to utilize the replace method to remove underscores in the "Name_en" field, but it doesn't seem to work as intended. I've also explored the use of expressionInfos without success.
If anyone has encountered a similar issue or has suggestions on how to correctly format the "Name_en" field within a PopupTemplate, I would greatly appreciate your insights.
Thank you in advance for your assistance!
Best regards,
Karim