Select to view content in your preferred language

Save original value when edited

369
1
Jump to solution
11-28-2023 11:57 AM
JonathanTanis1
Emerging Contributor

Hi everyone, I've got a maintenance survey set up with a parent record for maintenance locations plus several child record/repeats for maintenance visits. There's some parent record attributes that are referenced by the child records in calculations. That's all working fine, however on a semi-regular basis field staff will need to adjust the attributes of the parent record while in the field. In these cases, we'd like to save the original values, and when they were changed.

In the past, we've had "changed installation info" fields in the child record, which the calculations use if those fields are filled out. However, this requires someone to manually go in and adjust the parent record attributes on the backend, and we want to avoid that step.

- Is there a way to prevent a field from recalculating? One idea was the existing parent attributes could be saved as hidden fields in the child record. However, once the parent attributes are changed, the child fields automatically recalculate. If there was a way to prevent that, the previous values would be saved automatically.

- Another idea was that the parent attributes could be saved in another related table/repeat, and that if the information changed, it could just be saved as another repeat record. Is there a way to have the calculations in one repeat reference the values of only the most recent instance of another repeat?

Thanks!

1 Solution

Accepted Solutions
ChristopherCounsell
MVP Regular Contributor

Check out calculationModes. 

https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-calculation-modes/...

Or once() calculation function, if you never want to recalculate over an existing value.

You can create a survey for the Inbox with two options:

  • Enter data into repeat (repeat_count 1) > always calculate hidden parent record
  • Edit data in parent table > calculate hidden repeat

This lets you update the parent table, either directly or through the repeat, while capturing the data change in the related table.

If you don't use the inbox, go with adds via repeat, and use python notebooks to update the parent table.

View solution in original post

1 Reply
ChristopherCounsell
MVP Regular Contributor

Check out calculationModes. 

https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-calculation-modes/...

Or once() calculation function, if you never want to recalculate over an existing value.

You can create a survey for the Inbox with two options:

  • Enter data into repeat (repeat_count 1) > always calculate hidden parent record
  • Edit data in parent table > calculate hidden repeat

This lets you update the parent table, either directly or through the repeat, while capturing the data change in the related table.

If you don't use the inbox, go with adds via repeat, and use python notebooks to update the parent table.