Select to view content in your preferred language

Calculations in nested repeats not updating.

175
2
Jump to solution
a month ago
JoelRogers
New Contributor II

I have an inspection form with repeats within other repeats. The main repeat in a survey contains information about locations inspected during one day. The nested repeat records multiple sites within one location. I have a calculation that sums up numbers from a value (gallons) for each site for each location, and a main calculation that sums up all the gallons for each location.

typenamelabelcalculation
begin repeattrip_recordTrip Record 
integerTrip_NumberTrip Number 
textLoading_ZoneLoading Zone 
    
begin repeatTreatment_sitesTreatment Sites for trip: ${Trip_Number} 
select_one waterbodiesRivers_filterWaterbody Filter 
select_one sitessiteSite Name 
integerGallonsGallons 
end repeat   
    
integerTotal_gallonsTrip gallons sum(${Gallons})
end repeat   
    
integerall_trip_gallonsTotal Gallonssum(${Total_gallons})

 

When users were filling out the survey recently, they noticed that moving back and forth between repeats to make corrections locked the calculations and the totaled sums could no longer be updated. You can change the value in the Gallons field for any of the nested repeats, but it no longer updated the calculations below. Is this new behavior?

I am using Survey123 version 3.19.121

0 Kudos
1 Solution

Accepted Solutions
abureaux
MVP Regular Contributor
0 Kudos
2 Replies
abureaux
MVP Regular Contributor

Have you tried calculationMode=always?

0 Kudos
JoelRogers
New Contributor II

This was the solution. Thanks.

0 Kudos