# Insiders Call Summary: Using Entities to prevent duplicates and show summaries 👯

**URL:** <https://forum.getodk.org/t/insiders-call-summary-using-entities-to-prevent-duplicates-and-show-summaries/46785>\
**Category:** Community\
**Created:** [May 9, 2024, 11:35am UTC](https://forum.getodk.org/t/insiders-call-summary-using-entities-to-prevent-duplicates-and-show-summaries/46785 "2024-05-09T11:35:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aly\_Blenkin](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/aly_blenkin/32/19303_2.png) [@Aly\_Blenkin](https://forum.getodk.org/u/Aly_Blenkin)\
**Post date:** [May 9, 2024, 11:35am UTC](https://forum.getodk.org/t/insiders-call-summary-using-entities-to-prevent-duplicates-and-show-summaries/46785/1 "2024-05-09T11:35:24Z")

</div>

[https://youtu.be/LGX8hQrhDiw](https://youtu.be/LGX8hQrhDiw)

**Highlights**

- 🗺 Roadmap: Brief overview (@Aly_Blenkin)
- ⚡ Lightning talk: @Rudo shares his work supporting Indigenous communities
- 🤿 Deep dive: Using Entities to prevent duplicates and show work summaries (@LN)

**Resources**

- [Slide deck](https://docs.google.com/presentation/d/1qMsKy3EqpnbJgEWy79FLSd4mxAnk_kyM08Y0FukLBmE/edit)
- [Rudo on LinkedIn](https://www.linkedin.com/in/rudo-kemper/)
- [ODK roadmap](https://getodk.org/roadmap)

**Want to join the [@Insiders](https://forum.getodk.org/groups/insiders) call on June 5th?**  
[Learn how to become an Insider](https://forum.getodk.org/t/announcing-the-odk-insiders-program/45134) so you can participate in the monthly calls.

---

<div class="post-metadata">

**Author:** ![nmambre](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/nmambre/32/24362_2.png) [@nmambre](https://forum.getodk.org/u/nmambre)\
**Post date:** [May 9, 2024, 1:41pm UTC](https://forum.getodk.org/t/insiders-call-summary-using-entities-to-prevent-duplicates-and-show-summaries/46785/2 "2024-05-09T13:41:48Z")

</div>

I'm unable to access the slides, can you please check the permissions?

---

<div class="post-metadata">

**Author:** ![LN](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/ln/32/1605_2.png) [@LN](https://forum.getodk.org/u/LN)\
**Post date:** [May 9, 2024, 5:14pm UTC](https://forum.getodk.org/t/insiders-call-summary-using-entities-to-prevent-duplicates-and-show-summaries/46785/3 "2024-05-09T17:14:49Z")

</div>

Thanks for flagging that, @nmambre! It should be fixed now.

We'll work to get all of the information that's not already in the documentation included. If you have thoughts on aspects that were particularly helpful or that didn't work well for you, we can use that feedback to keep improving.

Insiders: I'll share info about the two May entity office hour sessions in a few minutes and I look forward to diving even deeper then!

---

<div class="post-metadata">

**Author:** ![chun\_hing\_yap](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/chun_hing_yap/32/13598_2.png) [@chun\_hing\_yap](https://forum.getodk.org/u/chun_hing_yap)\
**Post date:** [April 25, 2025, 12:54am UTC](https://forum.getodk.org/t/insiders-call-summary-using-entities-to-prevent-duplicates-and-show-summaries/46785/4 "2025-04-25T00:54:24Z")

</div>

Can you share the form example for constraint for duplicate as shown in the video?

---

<div class="post-metadata">

**Author:** ![LN](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/ln/32/1605_2.png) [@LN](https://forum.getodk.org/u/LN)\
**Post date:** [April 29, 2025, 3:52pm UTC](https://forum.getodk.org/t/insiders-call-summary-using-entities-to-prevent-duplicates-and-show-summaries/46785/5 "2025-04-29T15:52:24Z")

</div>

The form from the video was [enroll student in program](https://docs.google.com/spreadsheets/d/18-iW7Ll_oQlUeiEW6sic85G0bN7FQwT4511ZVpUYdh8/edit?gid=1068911091#gid=1068911091).

Here are a couple more examples of the same technique used in a couple different ways: [register unique subjects](https://docs.google.com/spreadsheets/d/18MRK7-FUC9BbKRNFJmWVGBhdZJoY2XOeqOEVeFO5lLE/edit?gid=1068911091#gid=1068911091), [register enumerator](https://docs.google.com/spreadsheets/d/1DAQHUzp8VjFzm5ArLJqXnjd0eV9IMXQYrfyKCG3URpQ/edit?gid=1068911091#gid=1068911091).

Please note that this doesn't work well with server edits because when you make an edit you use the latest version of the Entity List which will contain the registered Entity, failing the uniqueness check.

---

<div class="post-metadata">

**Author:** ![chun\_hing\_yap](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/chun_hing_yap/32/13598_2.png) [@chun\_hing\_yap](https://forum.getodk.org/u/chun_hing_yap)\
**Post date:** [April 30, 2025, 1:11am UTC](https://forum.getodk.org/t/insiders-call-summary-using-entities-to-prevent-duplicates-and-show-summaries/46785/6 "2025-04-30T01:11:48Z")

</div>

Thanks for the sharing.

**Entity creation:**  
You are right that the form will fail the uniqueness check therefore it doesn't work well with server edit.

**Entity update:**  
This also applies when the relevance/constraint applies to an entity property. It makes me wonder about even more things.

> AFAIK  
> submission edit **will not re-trigger entity create** (re-registration) or **entity update** (attribute update). Hence, entity need to manually edited

If edit does require, the workaround to edit the submission and entity with constraint /relevance applied are

```
For entity update:
 * Using pyodk, to re-submit the edited xml for submission and manually update the entity
 * Or, manually edit the entity property to empty string, then edit the submission and re-update the entity manually.

For entity creation:
 * Delete the entity and reject the submission and re-create entity with new submission

```

Is there any better approach than this?

---

<div class="post-metadata">

**Author:** ![LN](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/ln/32/1605_2.png) [@LN](https://forum.getodk.org/u/LN)\
**Post date:** [May 1, 2025, 4:09am UTC](https://forum.getodk.org/t/insiders-call-summary-using-entities-to-prevent-duplicates-and-show-summaries/46785/7 "2025-05-01T04:09:52Z")

</div>

> [@chun\_hing\_yap](#):
>
> submission edit **will not re-trigger entity create** (re-registration) or **entity update** (attribute update)

That's correct. And the reason for that is that the Entity may have been changed from other sources so we consider the submission and the Entity to lead separate existences after the submission has been received and processed. In some workflows, it will still make sense to edit submissions because the submission data is what gets analyzed and Entities are just used to link submissions together. If this is what you're trying to do, I think we can modify the uniqueness check to work for edits.

If the goal is to edit the Entity, you can do that by editing it directly or by introducing an update form that can be used to edit some or all of an Entity's properties.

I would recommend trying to model your data so that for each piece of information you're collecting, either the submission or the Entity is considered the source of truth but not both. If that doesn't seem possible, it would be helpful to learn more about your workflow and we can dig into how to best model it.
