Select to view content in your preferred language

Smart Form Calculated Expression not populating

633
1
10-07-2022 05:01 PM
HMarcks
Occasional Contributor

My code works fine in ArcGIS Pro and in Map Viewer but I cannot get it to work in field maps when there are other records.  If I remove all child records and create the parent fresh it works but as soon as I have one record I cannot add another.  The calculated field says "Failed to Calculate" and I can't figure out why.

var child_fs = FeatureSetByRelationshipName($feature,"TurfArea",["Area", "Status"])

var filterd_child_fs = Filter(child_fs, "Status = 0")
if(filterd_child_fs == null) { return }

return Sum(filterd_child_fs, "Area")

If anyone can help me out here I would greatly appreciate it.

0 Kudos
1 Reply
DougBrowning
MVP Esteemed Contributor

Is it maybe a 1:1 relationship?  Also try using FeatureSetbyName instead it has been posted on here many times that ByRelationshipName does not work a lot of the time (search the board on it).  Esp with special chars in the name.  Changing to ByName seems to do it.  

Hope that helps

0 Kudos