# Repeat group related functions

**URL:** <https://forum.communityhealthtoolkit.org/t/repeat-group-related-functions/2748>\
**Category:** Development\
**Tags:** forms, cht-core\
**Created:** [May 17, 2023, 5:39am UTC](https://forum.communityhealthtoolkit.org/t/repeat-group-related-functions/2748 "2023-05-17T05:39:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gilbert](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/gilbert/32/1325_2.png) [@Gilbert](https://forum.communityhealthtoolkit.org/u/Gilbert)\
**Post date:** [May 17, 2023, 5:39am UTC](https://forum.communityhealthtoolkit.org/t/repeat-group-related-functions/2748/1 "2023-05-17T05:39:00Z")

</div>

Just a small question. Are the count(nodeset), sum(nodesetMember), min(nodesetMember) and max(nodesetMember) functions of enketo supported in CHT 3.15?  
Thank you

---

<div class="post-metadata">

**Author:** ![jkuester](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/jkuester/32/806_2.png) [@jkuester](https://forum.communityhealthtoolkit.org/u/jkuester)\
**Post date:** [May 17, 2023, 1:59pm UTC](https://forum.communityhealthtoolkit.org/t/repeat-group-related-functions/2748/2 "2023-05-17T13:59:48Z")

</div>

Unfortunately, CHT 3.x has only limited support for repeats (and their helper functions). I believe that `min` and `max` should work as expected, but the `count` and `sum` functions are not supported.

The new version of Enketo in CHT 4.x has added much better support for repeats and all these functions should work as expected.

---

<div class="post-metadata">

**Author:** ![oyierphil](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/oyierphil/32/946_2.png) [@oyierphil](https://forum.communityhealthtoolkit.org/u/oyierphil)\
**Post date:** [July 13, 2024, 6:04am UTC](https://forum.communityhealthtoolkit.org/t/repeat-group-related-functions/2748/3 "2024-07-13T06:04:51Z")

</div>

@jkuester, testing an instance on 3.17, planning to upgrade once everything works to 4.x, we gave a select multiple question for lab test, where someone can select more than one lab test, and for each test, indicate the results, the form works on KoBo, but running the same on CHT, doesn’t provide the option for indicating the results of each lab test taken as below:

 ![Repeat_Group](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/4/4a12a1b318e8e61b4e99894cb07d74f1ed5142d2.png)

---

<div class="post-metadata">

**Author:** ![jkuester](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/jkuester/32/806_2.png) [@jkuester](https://forum.communityhealthtoolkit.org/u/jkuester)\
**Post date:** [July 15, 2024, 6:05pm UTC](https://forum.communityhealthtoolkit.org/t/repeat-group-related-functions/2748/4 "2024-07-15T18:05:12Z")

</div>

I tried a form with the same config, running in `4.9` code and it seems to work like I would expect:

 ![image](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/c/cbd4116e5e8b779aa9f527b10338537e19c209af.png)

What type of unexpected behavior are you seeing? Also, from your screenshot, it looks like you are putting the repeat inside the `inputs` group. I am not sure if that is related or not, but you might try moving the repeat out of `inputs`.

---

<div class="post-metadata">

**Author:** ![oyierphil](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/oyierphil/32/946_2.png) [@oyierphil](https://forum.communityhealthtoolkit.org/u/oyierphil)\
**Post date:** [July 16, 2024, 8:24pm UTC](https://forum.communityhealthtoolkit.org/t/repeat-group-related-functions/2748/5 "2024-07-16T20:24:24Z")

</div>

@jkuester, with the upgrade to CHT 4.9, the repeat group and related functions in XLSForms are working as expected, always appreciate the support.
