# Same Household Code "001" Saved Twice (Duplicate Issue)

**URL:** <https://forum.getodk.org/t/same-household-code-001-saved-twice-duplicate-issue/57899>\
**Category:** Support\
**Tags:** form-design, odk-xlsform\
**Created:** [March 24, 2026, 4:48am UTC](https://forum.getodk.org/t/same-household-code-001-saved-twice-duplicate-issue/57899 "2026-03-24T04:48:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thaingar](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/thaingar/32/29429_2.png) [@Thaingar](https://forum.getodk.org/u/Thaingar)\
**Post date:** [March 24, 2026, 4:48am UTC](https://forum.getodk.org/t/same-household-code-001-saved-twice-duplicate-issue/57899/1 "2026-03-24T04:48:20Z")

</div>

I am experiencing an issue with the Household Code field. When I enter "001", it is being saved twice (e.g., duplicated in the dataset). Please see my code below. Could you please advise why this is happening and how can I fix it?

 ![duplicate](https://getodk.b-cdn.net/uploads/default/original/3X/9/0/90250572de20467995ee7db33b3651d86ea1cd93.jpeg)  
[HH Screening\_duplicate.xlsx](https://forum.getodk.org/uploads/short-url/1kkOylfeAukZNOergAfnlfqLXKi.xlsx) (602.5 KB)

---

<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:** [March 30, 2026, 12:15am UTC](https://forum.getodk.org/t/same-household-code-001-saved-twice-duplicate-issue/57899/2 "2026-03-30T00:15:43Z")

</div>

I was not able to replicate your issue. I submitted two entries and the data was not duplicated. The household code matched what I entered. Your form requires the user to input the correct household code. If the user inputs “001” twice, then it will be in the output data twice.

 ![Screenshot 2026-03-29 at 8.11.12 PM](https://getodk.b-cdn.net/uploads/default/original/3X/0/8/0867b3b87cebd8857113ccf74d3d42ef61a665d4.png) ![Screenshot 2026-03-29 at 8.11.34 PM](https://getodk.b-cdn.net/uploads/default/original/3X/5/6/567673561c9061a7ba4d0b234ec11be3c50fa403.png)

_(above) the two surveys and (below) the output data_

 ![Screenshot 2026-03-29 at 8.12.20 PM](https://getodk.b-cdn.net/uploads/default/original/3X/a/5/a522a786c80418053dd7740ea6796f2eb1732361.png)

---

<div class="post-metadata">

**Author:** ![Thaingar](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/thaingar/32/29429_2.png) [@Thaingar](https://forum.getodk.org/u/Thaingar)\
**Post date:** [May 28, 2026, 12:58pm UTC](https://forum.getodk.org/t/same-household-code-001-saved-twice-duplicate-issue/57899/3 "2026-05-28T12:58:48Z")

</div>

Thank you so much for your detailed explanation.

What I mean is that if a user enters the same household code (for example, “001”) more than once, the form currently allows both entries without showing any error.

I would like the form to display an error message or validation warning when a household code that has already been entered is entered again, in order to prevent duplicate household codes in the output data.

Thank you again for your support and guidance.

---

<div class="post-metadata">

**Author:** ![yanokwa](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/yanokwa/32/1695_2.png) [@yanokwa](https://forum.getodk.org/u/yanokwa)\
**Post date:** [May 28, 2026, 1:34pm UTC](https://forum.getodk.org/t/same-household-code-001-saved-twice-duplicate-issue/57899/4 "2026-05-28T13:34:44Z")

</div>

You can use Entities to prevent duplicates.

For example, this is a form snippet from the [share choices across forms](https://docs.getodk.org/tutorial-shared-choices/) tutorial that prevents duplicate site codes. You can do something similar with households.

 ![image](https://getodk.b-cdn.net/uploads/default/original/3X/7/8/78f98243db7f64557936a4950e82ef5f0a79fe50.png)

---

<div class="post-metadata">

**Author:** ![Thaingar](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/thaingar/32/29429_2.png) [@Thaingar](https://forum.getodk.org/u/Thaingar)\
**Post date:** [May 29, 2026, 9:46am UTC](https://forum.getodk.org/t/same-household-code-001-saved-twice-duplicate-issue/57899/5 "2026-05-29T09:46:49Z")

</div>

Well noted, and many thanks for your guidance. I’ll try using Entities in the same way to prevent duplicate household codes. I really appreciate your support!
