since the last AGOL update my attribute expression is no longer working it just returns
[object Object]
this is a simplified example with just one if and it returns the correct data in the arcade editor when you run it
but just returns [object Object] in the popup when you click on the polygon in the map.
any ideas?
Solved! Go to Solution.
This technically isn't a valid expression for attribute popups. As stated in the Arcade documentation, the only valid return types for the popup profile is "text" and "number" (https://developers.arcgis.com/arcade/profiles/popup/#return-types). This has always been the case. No other return type has been officially supported by Esri. Therefore, we will not make changes that allow for creating tables from a direct dictionary return for attribute popups.
However, the desired behavior is already possible in the Popup Element Profile (https://developers.arcgis.com/arcade/profiles/popup-element/#return-types), which only supports Dictionary as a valid return type. With this profile, you can dynamically create field info lists, html tables and other elements, and popup charts. It is much more powerful and capable than returning plain Arcade dictionaries as you can style and dynamically return different elements depending on data values.
Several blog articles have been written about this as well. I would start with this one: https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/part-1-introducing-arcade-pop-up-con...
Taylor
Hello @StuartMoore , I believe you may have encountered this Bug, ref BUG-000180482.
thanks @ChrisUnderwood do you have details on the bug?
i've had to re-create it thankfully i found this post which helped: Conditional Field display with Arcade in Pop Ups (... - Esri Community
Stu
This technically isn't a valid expression for attribute popups. As stated in the Arcade documentation, the only valid return types for the popup profile is "text" and "number" (https://developers.arcgis.com/arcade/profiles/popup/#return-types). This has always been the case. No other return type has been officially supported by Esri. Therefore, we will not make changes that allow for creating tables from a direct dictionary return for attribute popups.
However, the desired behavior is already possible in the Popup Element Profile (https://developers.arcgis.com/arcade/profiles/popup-element/#return-types), which only supports Dictionary as a valid return type. With this profile, you can dynamically create field info lists, html tables and other elements, and popup charts. It is much more powerful and capable than returning plain Arcade dictionaries as you can style and dynamically return different elements depending on data values.
Several blog articles have been written about this as well. I would start with this one: https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/part-1-introducing-arcade-pop-up-con...
Taylor