Select to view content in your preferred language

Calculation problem when adding new fields

435
1
08-03-2021 11:14 AM
HaroldHerrera1
Frequent Contributor

I have a problem with the sum of several fields in a survey.

Context: 

We are collecting data for construction projects. We need to sum the different types of professional members of the team, for this, every type of worker has a field.  We designate a field with the calculation: ${WorkerType1}+${WorkerType2}+... and publish.

Problem:

The number of workers types have increased, and we need to sum for the total of workers. The update for the calculation field is ${WorkerType1}+${WorkerType2}+...+${NewWorkerType1}+${NewWorkerType2}+... and republish.

Everything looks good in the app, the calculation is fine, BUT when we explore the data in the Feature Service the calculation was wrong! the data of the new fields are not added to the calculation.

All the fields are esriFieldTypeInteger: Integer, default: 0, Constraint: .>=0

Some ideas for correct the calculation?

0 Kudos
1 Reply
DougBrowning
MVP Esteemed Contributor

Do you mean data from before the form was changed?  If so then yes if the form is not opened again it cannot update the existing records.  The form calcs and the feature service really have nothing to do with each other.  123 does its part then sends the data to the feature service.  It would be like adding a photo to the cloud then editing the photo on your phone.  They are diff copies.

What you are expecting is called an Attribute Rule that works on the feature service itself.  Those are coming but not here yet.  They will be run by AGOL vs 123.

For now you could use an Arcade expression to show the values of the old records.  Note it is not a real field so would not show on export.

Hope that helps

0 Kudos