Deleted
Klewis47,
Which Arcade profile and ArcGIS app are you using? Since you posted under ArcGIS Online, I'm assuming you're using the Field Calculation profile. In that profile, Arcade returns either a date, a number, or text. Your code is returning a dictionary which is not available for Field Calculation.
This is a Calculation Attribute Rule.
To post code in the community (much more legible than plain text or screenshots):
Does this do what you want?
var rel_fs = FeatureSetByName($datastore, "MAPS_D.SDE.SFAM_Relational_Table", ['ObjectID', 'footprint_id '], false) var id = $feature['footprint_id '] var matches = Filter(rel_fs, 'footprint_id = <a href="https://community.esri.com/t5/user/viewprofilepage/user-id/354972">@ID</a>') var updates = [] var adds = [] for(var m in matches) { var update = { 'objectID': m.OBJECTID, 'attributes': { 'footprint_area': $feature['shape_area'] } } Push(updates, update) } if(Count(updates) == 0) { var add = { 'attributes': { 'footprint_id ': $feature['footprint_id '], 'footprint_area': $feature['shape_area'] } } Push(adds, add) } return { 'edit': [{ 'className': 'MAPS_D.SDE.SFAM_Relational_Table', 'adds': adds, 'updates': updates }] }
Oof. Writing this in a popup expression complicates the search for errors, because popups use a different set of functions than Attribute Rules. And you're using the Classic Viewer, which only makes it harder.
Some suggestions:
var d = { 'edit': [{ //... }] } return Text(d)
// After line 1 Console(Count(rel_fs)) // should print > 0 // After line 3 Console(Count(matches)) // should print >= 0 // After line 7 Console(m.OBJECTID) // should print the OBJECTID of every processed related row // After line 24 Console(updates) // should print the updates dictionary Console(adds) // should print the adds dictionary
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.