Hello everyone,
I have a form that includes a repeat block, and within this repeat block, there is a single decimal field where users will input values. I want to achieve two things:
- Automatically calculate the subtraction of all these entered values in another field outside the repeat block. If the result is negative, I want to convert it to a positive number (i.e., take the absolute value).
- Automatically find and display the highest value entered in the repeat block in another field.
For instance, if the repeat block has values like this:
Repeat Block:
1. repeat value = 10
2. repeat value = 5
3. repeat value = 3
The resulting fields should display:
- Total absolute subtraction: |10 - 5 - 3| = 2
- Highest value: 10
I've tried using calculations within the XLSForm, but I'm struggling to find a way to dynamically iterate through the repeat entries and perform the subtraction. Does anyone have experience with this or know of a solution that can be implemented directly in Survey123? Is this even possible to achieve within the Survey123 framework?
If this cannot be achieved directly in Survey123, I'm open to suggestions involving webhooks or other post-processing methods.
Any help or guidance would be greatly appreciated!
Thank you!