Select to view content in your preferred language

Dot notation and Square bracket notation don't work in Arcade Element in Popup in Field Maps mobile app

122
0
Tuesday
Labels (1)
Scott_Sambell
Frequent Contributor

In short - When you use either Dot Notation (var attribute = row.fieldname) or Square bracket notation (var attribute = row["fieldname']) in an Arcade element in a popup in Map Viewer, it all works great until you open the popup in the Field Maps app.  Then you get the an error like this for that element in the popup....

Scott_Sambell_0-1762295690924.png

What should i be using instead of dot notation or square bracket notation?  Do i have to make a dictionary first or something?  The code itself is being used in heaps of other places in the system so i know it all good, i just need to use an Arcade element for this particular element (instead of a Text element) for reasons too complex to go into right now (this version of the code works fine in the text element)

It seems like a crazy thing to get stumped on because dot notation is so common in all of our code.  For some reason i have never used it in an Arcade element in a Popup in Field Maps before. 

For more context here is a small snippet of the code... 

var fs = FeatureSetByName($map, "Cats registered on property",['OBJECTID','EngagementPropertiesID','CatName'],false)
var ffsp = filter(fs,'EngagementPropertiesID IN @UIDs')
var catcnt = count(ffsp)
if (catcnt == 0) 
return { 
	type : 'text', 
	text : "There are no cats"
}
else {
var firstrow = First(OrderBy(ffsp,'OBJECTID')) ;

//if i show either of these options the popup give an error in field maps...
    //var firstcat = firstrow.CatName ;
    //var firstcat = text(firstrow["CatName"]) ;

 Any ideas?  I am so close on this and this is the most straight forward thing about the entire thing!

Thanks ❤️

Scott
0 Kudos
0 Replies