Arcade expression problem

461
1
03-03-2022 02:03 AM
D_CGIS
by
New Contributor II

Hi, I have a problem about using Arcade .

When I run this code, I get an error message

I don't know how to fix it.

Thanks

 

 

var contents = FeatureSetByAssociation($feature, 'connected')
var updateList = []
var counter = 0
for (var content in contents) {
  updateList[counter] = {
    'globalid': content.globalid,
    'attributes': {
      'topageno': frompageno,
    },
  }

  counter++
}
return {
  'result': $feature.frompageno,
  'edit': [
    {
      'className': 'xxxxxx',
      'updates': updateList,
    },
  ],
}

 

 

 

D_CGIS_0-1646301320763.png

 

0 Kudos
1 Reply
Jake_S
by
Occasional Contributor II

D,

Want to get a few bits of details. Is this being used for Utility Network? 

Also, have you run this in a console or do a simple error message to get a count of the contents?

I'm wondering if the counter is not advancing.

var contents = FeatureSetByAssociation($feature, 'connected')
// If there is no contents, exit the function
if (count(contents) == 0) {
    return null;
}
var updateList = [];
var counter = 0;
for (var content in contents) {
  updateList[counter++] = {'globalid': content.globalid,
    'attributes': {'topageno': frompageno}
    };
  }

return {
  'result': $feature.frompageno,
  'edit': [{
      'className': 'xxxxxx',
      'updates': updateList
    }]
}

 

~Jake

0 Kudos