Select to view content in your preferred language

Arcade Popup Element not appearing consistently

313
4
04-02-2025 07:31 PM
Labels (1)
BlakeMorrison
Frequent Contributor

I have a couple of arcade elements creating the fields list in a Map Viewer popup. There seems to be some issue displaying/running the elements under certain circumstances:

  • I'm experiencing one element just not appearing
  • while another element seems to not recognise a code change I have made.

If I add a standard fields list element into the popup, these issues disappear and the popup behaves as expected. If I remove all the fields from the fields list, or just remove the fields list entirely, the issue reoccurs, including the code change no longer being recognised.

 

Screenshots attached only show the element disappearing entirely.2elements-problem.jpg3elements-noproblem.jpg

 

EDIT: With a little bit more playing I'm now not able to display any values via an arcade fields element unless they're already being displayed in a normal fields list. Ie. I can control which portions of my arcade elements work based on the attributes I display in a standard field list.

 

There's something wrong with the rendering profile I guess.

 

0 Kudos
4 Replies
BlakeMorrison
Frequent Contributor

I'm playing with this still. I've simplified my arcade popup element down to a single field with no fanciness. Code as follows:

 

 

return {
  "fieldInfos": [
    {
      "fieldName": "variety1", // field name from feature service
      "visible": true,
      "isEditable": true,
      "label": "Var1"
    }
  ],
  "type": "fields"
}

 

The documentation here would seem to indicate I should have access to $feature profile variables: https://developers.arcgis.com/arcade/profiles/popup-element/

I can make an arcade text element that calls $feature profile variables on it's own, but not an arcade fields element.

 

For now, my workaround is to have an attribute expression that lists all the $feature variables I would like to use, this allows arcade field elements to function as normal.

0 Kudos
timcneil
Esri Contributor

Hi @BlakeMorrison , 

Try using the Expects() function at the beginning of your script to reference any fields from you need for your fields element.

This should fix your issue and prevent you from having to reference particular fields in your normal fields list, as you mention below:


@BlakeMorrison wrote:

EDIT: With a little bit more playing I'm now not able to display any values via an arcade fields element unless they're already being displayed in a normal fields list. Ie. I can control which portions of my arcade elements work based on the attributes I display in a standard field list.

 


0 Kudos
BlakeMorrison
Frequent Contributor

That seems like a good workaround too. Are you able to comment on whether my issue is expected functionality?

0 Kudos
BlakeMorrison
Frequent Contributor

I've been in touch with support and they directed me towards a support article which is a similar issue, with a similar workaround, though apparently marked as As Designed: https://support.esri.com/en-us/bug/inconsistent-behavior-in-the-map-viewer-popups-when-con-bug-00017...

 

I don't think it's the same issue as I can reference any $feature attributes I want in an arcade popup text element, but not in an arcade popup fields element.

0 Kudos