# Repeat function does not update when going back on ODK Collect

**URL:** <https://forum.getodk.org/t/repeat-function-does-not-update-when-going-back-on-odk-collect/34239>\
**Category:** Support\
**Created:** [July 8, 2021, 11:36am UTC](https://forum.getodk.org/t/repeat-function-does-not-update-when-going-back-on-odk-collect/34239 "2021-07-08T11:36:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Olimpia](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/olimpia/32/13363_2.png) [@Olimpia](https://forum.getodk.org/u/Olimpia)\
**Post date:** [July 8, 2021, 11:36am UTC](https://forum.getodk.org/t/repeat-function-does-not-update-when-going-back-on-odk-collect/34239/1 "2021-07-08T11:36:06Z")

</div>

Hello everyone,

I hope you are good and safe.

**1. What is the problem? Be very detailed.**  
I am designing a survey where I ask the following:

1. "How many samples will you examine today?"
2. Set of questions on the samples that are repeated for x times where x is the number entered in question 1.

This all works fine in ODK Collect. However, if I first enter 4 in question 1 and then I change my mind and go back, and enter 5, the second set of questions does not update and will be asked four times instead of five. Is there any way in the settings to change this?

Many thanks in advance for your help

Best,  
Olimpia

---

<div class="post-metadata">

**Author:** ![danbjoseph](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/danbjoseph/32/21901_2.png) [@danbjoseph](https://forum.getodk.org/u/danbjoseph)\
**Post date:** [July 13, 2021, 1:31am UTC](https://forum.getodk.org/t/repeat-function-does-not-update-when-going-back-on-odk-collect/34239/2 "2021-07-13T01:31:42Z")

</div>

Can you please upload your form here? I could not replicate the issue. When I went back and increased the number, the number of repeats also increased.  
This is the form I tested: [repeat\_number\_of\_times.xlsx](https://forum.getodk.org/uploads/short-url/2TPfHmDm3WD3Kwh0xaV6f04fE63.xlsx) (8.8 KB)

```plaintext
+--------------+-----------------+--------------------+--------------+--------------+
| type | name | label | calculation | repeat_count |
+--------------+-----------------+--------------------+--------------+--------------+
| integer | my-number | How many? | | |
| begin repeat | | | | ${my-number} |
| calculate | repeat-position | | position(..) | |
| note | repeat-note | ${repeat-position} | | |
| end repeat | | | | |
+--------------+-----------------+--------------------+--------------+--------------+

```

Please note the behavior when **decreasing** the count as discussed here:

> [@Dynamic Repeat Group does not work properly if the number of repetitions is updated](https://forum.getodk.org/t/dynamic-repeat-group-does-not-work-properly-if-the-number-of-repetitions-is-updated/27763/2):
>
> Hi @nnsdtr_github This is a known behavior: [https://docs.getodk.org/form-repeats/](https://docs.getodk.org/form-repeats/) If the count is decreased by a user, no groups will be deleted. This avoids accidental data loss: a user who accidentally sets the count too low can set it to a higher number and still have the repetitions that were previously created. There is also a recommended workaround: [https://docs.getodk.org/form-repeats/#id6](https://docs.getodk.org/form-repeats/#id6)
