Skip to content

Create offline entities from entities in repeats#6978

Merged
grzesiek2010 merged 41 commits intogetodk:masterfrom
grzesiek2010:entities_with_repeats
Jan 8, 2026
Merged

Create offline entities from entities in repeats#6978
grzesiek2010 merged 41 commits intogetodk:masterfrom
grzesiek2010:entities_with_repeats

Conversation

@grzesiek2010
Copy link
Member

@grzesiek2010 grzesiek2010 commented Nov 29, 2025

Closes #6876

Why is this the best possible solution? Were any other approaches considered?

The main change worth noting is that I reworked EntityFormExtra to store a list of SaveTo objects. Previously, it held only a pair containing a reference and a value. However, to reliably match SaveTo entries to their entities, I also needed to store the corresponding entity group reference. I obtain that by locating the nearest entity block. Thanks to this, the lookup is performed only once when the form is opened for the first time and then cached. As a result, form finalization does not requires any complex matching operations.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

This adds support for creating entities from multiple regular groups, repeat groups, and nested repeats, all using different datasets. Instead of being limited to creating just one entity per form, as is currently the case, we can now handle essentially any scenario we need.
Be creative, as always! I’m sure you already have a number of forms with entities, so the first step is to ensure there are no regressions. After that, we can adapt those forms to take advantage of the new possibilities.

Do we need any specific form for testing your changes? If so, please attach one.

Any variations of forms that include entities and groups/repeats.

Does this change require updates to documentation? If so, please file an issue here and include the link below.

It's already there getodk/docs#1987.

Before submitting this PR, please make sure you have:

  • added or modified tests for any new or changed behavior
  • run ./gradlew connectedAndroidTest (or ./gradlew testLab) and confirmed all checks still pass
  • added a comment above any new strings describing it for translators
  • added any new strings with date formatting to DateFormatsTest
  • verified that any code or assets from external sources are properly credited in comments and/or in the about file.
  • verified that any new UI elements use theme colors. UI Components Style guidelines

@grzesiek2010 grzesiek2010 force-pushed the entities_with_repeats branch 2 times, most recently from 19f3925 to 6780aea Compare December 7, 2025 16:30
@grzesiek2010 grzesiek2010 force-pushed the entities_with_repeats branch from 6780aea to 385de12 Compare December 8, 2025 12:24
@grzesiek2010 grzesiek2010 marked this pull request as ready for review December 8, 2025 22:30
@grzesiek2010 grzesiek2010 requested a review from seadowg December 8, 2025 22:38
Copy link
Member

@seadowg seadowg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just had an initial skim and answered your question!

@grzesiek2010 grzesiek2010 requested a review from seadowg December 13, 2025 16:25
@grzesiek2010 grzesiek2010 force-pushed the entities_with_repeats branch 2 times, most recently from 3d5910c to 4852994 Compare January 6, 2026 16:24
@grzesiek2010 grzesiek2010 force-pushed the entities_with_repeats branch from 4852994 to e6f7d29 Compare January 6, 2026 16:26
@grzesiek2010 grzesiek2010 requested a review from seadowg January 6, 2026 22:42
@grzesiek2010 grzesiek2010 requested a review from seadowg January 8, 2026 08:36
@grzesiek2010 grzesiek2010 merged commit d574284 into getodk:master Jan 8, 2026
7 checks passed
@dbemke
Copy link

dbemke commented Jan 15, 2026

We finished testing for now.
Currently it isn't possible to test xslx forms with nested repeats, parallel repeats and multiple dataset via Central so this part will be covered when it's ready in Central (issue mentioned above).
We focused on creating and updating entities in repeat and groups, validation of fields and properties and how entities are created offline.
One of main areas we focused on were calculations, filtering in registration/update forms and registration or update form.
There was also regression testing in entities area and upgrades.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Offline entities are created from entities in repeats

3 participants