ABQ_NR_DLY_LOG_v1.xlsx (25.1 KB)
So I am trying to setup a dynamic label for a repeat. The goal is to have certain pieces of information visible from the "table of contents" screen in ODK Collect, that way the user can refer to their progress while recording at a glance instead of having to actually open any particular instance of a repeat.
The catch I have run into involves adding an increment to the label for only certain repeats. For some recordings, it is not necessary to track how many have been counted, but for others it is necessary to know if the current recording is the first, second, third, and so on and so forth.
The calculation I've come up with uses the sum() function to conditionally count the relevant repeats and then display them in the label. But because ODK recalculates each time a group/repeat is open, the label for each entry is always the total number of relevant repeats, not a sequential list of which was the first, second, third entry.
I am a bit stumped as to what to try next. I can't use once() because I need the calculation to run once for each repeat, not once per instance. I can't use position() because there may be a circumstance where the relevant repeats are non-sequential, e.g. relevant, irrelevant, relevant, in which case the labels would display as relevant 1, relevant 3.
Is there any way to store the result of a calculation so it is preserved for an individual repeat? Or can someone think of some elaborate comparison I could do to make this work?
I've attached my form in case the above doesn't make any sense.