EDIT: I've isolated the problem to the Push function to supply the dictionary with the value. I can't see what I'm doing wrong here. Again, this works just fine in Map Viewer but not in Field Maps.
// Iterate through the filtered RCS, grab the Structure ID, convert it to a number, and then push it to the new Feature Set
for(var R in RCS_in_District){
var RCS_ID_txt = R['StructureID']
var RCS_ID_num = Number(RCS_ID_txt)
Push(
RCS_d["features"],
{
attributes: {
RCS_ID: RCS_ID_num,
},
},
)
}
This works just fine and dandy in Map Viewer but "fails to calculate" in Field Maps. Note that I am testing Field Maps online - I don't need a disconnected environment.
Goal: Use Arcade expression to autopopulate StructureID field in Road Class Structures with a unique sequential ID based upon the District it falls in.
Assumptions/Logic:
Process:
Solved! Go to Solution.
I solved my problem - it has to do with the semi-colons and commas that I see strewn all throughout the various Arcade examples I've looked at. So naturally I adopted them in my own script. But a closer look at the syntax for Push() shows I had too many commas and semi-colons, so I took them out and - voila - it works.
This is what my Push function looked like before:
Push(
RCS_d["features"],
{
attributes: {
RCS_ID: RCS_ID_num,
},
},
)
And this is what I changed it to:
Push(
RCS_d["features"],
{
attributes: {
RCS_ID: RCS_ID_num
}
}
)
So, I guess a larger question is - what is the purpose of all these commas and semi-colons I see in Arcade examples? From what I understand every Arcade statement should have a semi-colon on the end, but is that a stylistic convention or is it strictly necessary?
Anyways, my issue has been solved.
I solved my problem - it has to do with the semi-colons and commas that I see strewn all throughout the various Arcade examples I've looked at. So naturally I adopted them in my own script. But a closer look at the syntax for Push() shows I had too many commas and semi-colons, so I took them out and - voila - it works.
This is what my Push function looked like before:
Push(
RCS_d["features"],
{
attributes: {
RCS_ID: RCS_ID_num,
},
},
)
And this is what I changed it to:
Push(
RCS_d["features"],
{
attributes: {
RCS_ID: RCS_ID_num
}
}
)
So, I guess a larger question is - what is the purpose of all these commas and semi-colons I see in Arcade examples? From what I understand every Arcade statement should have a semi-colon on the end, but is that a stylistic convention or is it strictly necessary?
Anyways, my issue has been solved.