Select to view content in your preferred language

Map Popup expression returning [object Object]

213
3
Jump to solution
a week ago
StuartMoore
Frequent Contributor

since the last AGOL update my attribute expression is no longer working it just returns 
[object Object] 

StuartMoore_0-1761641057634.png


this is a simplified example with just one if and it returns the correct data in the arcade editor when you run it

StuartMoore_1-1761641383980.png

but just returns [object Object] in the popup when you click on the polygon in the map.

any ideas?

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
timcneil
Esri Contributor

@StuartMoore , 

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

View solution in original post

3 Replies
ChrisUnderwood
Esri Regular Contributor

Hello @StuartMoore , I believe you may have encountered this Bug, ref BUG-000180482. 

0 Kudos
StuartMoore
Frequent Contributor

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

0 Kudos
timcneil
Esri Contributor

@StuartMoore , 

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