Working with the old Webmapviewer in AGOL, I was able to create a popupTemplate. I used the information from this popupTemplate to draw the content of my custom fields based on the visibility flag, using the Javascript API.
for (var i = 0; i < featurelayer.popupTemplate.fieldInfos.length; i++) {
if (featurelayer.popupTemplate.fieldInfos[i].visible)) {
"draw field "
}
}
The new Webmapviewer provides a way to define a form, with extra options like 'allow edit' and the sort order of the fields. Can I request this information in the Javascript API and how should this be done?