Attribute order in search results from an AGO webmap call

287
0
02-06-2023 04:55 AM
DawnMcCall
New Contributor III

Good Morning,

We are having trouble with the order of our attributes in a custom widget. We are working on the javascript version 4.25.5 and are having issues getting the returned attribute values to honor the configuration in the popup set in the web map.  We have been able to do a simple identify and return the attributes in the correct order, but when we return the attributes in the widget the attributes are coming back in the field order from the web map.  We have tried changing the filed order, without success.  The attribute table is in the correct order, but the results are still showing in alphabetical order, which matches the attribute order in the web map. We think that we are missing a variable to call the popup configuration order.  Does anyone have any ideas? 

 

    result.fields = selectedResultLayer?.layer?.popupTemplate?.fieldInfos

      ?.filter((f) => f.visible)

      .map((f, i) => {

        return {

          name: f.fieldName,

          alias: f.label,

          value: result.resultInfo?.feature?.getAttribute(f.fieldName),

0 Kudos
0 Replies