This is a known issue that has to do with 'incorrect' behavior (of Enketo) when it comes to resolving refs the underlying XForm action [the same issue results in regular trigger
/setvalue
actions misbehaving too].
For all the gory details see Incorrect (setvalue) trigger behavior in Enketo when used inside repeats .
There's a couple Enketo bugs/issues tracking this here:
opened 09:28PM - 03 Sep 24 UTC
**Describe the bug**
When both the source trigger and target control are within… the same repeat group, the trigger only ever updates the control's value in the _first_ repeat iteration
**To Reproduce**
Steps to reproduce the behavior. If applicable please include the smallest possible XLSForm or XForm (as zip or link).
[RepeatWithTrigger.xlsx](https://github.com/user-attachments/files/16856220/RepeatWithTrigger.xlsx)
1. Answer the age question, you should then see a timestamp.
2. Add another repeat iteration
3. In the new (ie second) repeat, answer the age question
4. observe that the timestamp of the *first* iteration changes, whereas the timestamp of the second iteration remains blank.
Whenever you change the source trigger value in any repeat iteration, only the target control of the _first repeat iteration_ is updated.
**Expected behavior**
Whenever you change the source trigger value in a repeat iteration, only the target control of the _same repeat iteration_ should be updated. This is the behavior that is observed running the same form and scenario under ODK Collect.
**Screenshots**
This is an example of a repeat with 3 iterations. The trigger is the age question and the target is a calculation to record the timestamp. As shown, setting the age in either iteration 2 and 3 just keeps updating the timestamp in iteration 1, only.

**Browser and OS (please complete the following information):**
- OS: macOS 14.6
- Browser: Firefox
**Additional context**
Note, this behavior is similar to that observed for **odk:set-geopoint** actions too, when triggered inside a repeat; that is, only the target geopoint control of the first iteration is ever updated. See [<link TBD>](https://github.com/enketo/enketo/issues/1347)
opened 09:43PM - 03 Sep 24 UTC
**Describe the bug**
When both the source trigger and target control of the odk… :setgeopoint action are within the same repeat group, the trigger only ever updates the geopoint value in the first repeat iteration
**To Reproduce**
Steps to reproduce the behavior. If applicable please include the smallest possible XLSForm or XForm (as zip or link).
[RepeatWithSetgeopoint.xml.zip](https://github.com/user-attachments/files/16856610/RepeatWithSetgeopoint.xml.zip)
1. Answer the age question, you should then see a geopoint.
2. Add another repeat iteration
3. In the new (ie second) repeat, answer the age question
4. observe that the geopoint of the first iteration changes, whereas the geopoint of the second iteration remains blank.
**Expected behavior**
Whenever you change the source trigger value in a repeat iteration, only the target control of the same repeat iteration should be updated with the new geopoint location. This is the behavior that is observed running the same form and scenario under ODK Collect.
**Screenshots**
This is an example of a repeat with 3 iterations. The trigger is the age question and the target is a geopoint control set by the xform-value-changed triggered odk:setgeopoint action. As shown, setting the age in either iteration 2 and 3 just keeps updating the location in iteration 1, only.

**Browser and OS (please complete the following information):**
- OS: macOS 14.6
- Browser Firefox
**Additional context**
Note, this behavior is similar to that observed for **setvalue** actions too, when triggered inside a repeat; that is, only the target control of the first iteration is ever updated. See https://github.com/enketo/enketo/issues/1346
**These may well have the same root cause!** However, I've opened separate tickets for each since they are different XForm actions, and whereas setvalue is a _synchronous_ operation, odk:setgoepoint is _asynchronous_. So they could potentially have different underlying cause but similar consequences.
1 Like