Referring to a Thing from a Repeating Group does not get stored in the database

Very weird: Relationships between new Things display correctly on screen but do not get stored to the database.

I use two repeating groups with fixed number of rows and columns (1 each) and use forward and back buttons to navigate between entries (like flipping cards with 1 Thing each). All good.

The things between the two lists are referred to from both sides to create parent-child relationships:

  • a list of A’s and a list of B’s
  • Each B has a field to relate it to one A
  • the A gets each new B added to it’s list of B’s.

If I create a new Thing for one of the lists and add the links to the element from the other list, then the following happens:

  1. Everything works on screen and I can navigate both lists and the references behave/show as expected.
  2. BUT this reference is never stored to the database, just kept in browser memory. The other fields of the thing get saved properly, so the new thing exists. But the reference is not saved on either side, it just remains empty.
  3. THUS if I reload the screen the references are gone. The new Things do exist in the database but as with no relations to access them they are “lost” to the user.

Note:
The way I identify the current object might be at the core to the problem, have tried other ways now with the same logic and it simply does not store (but does display) the related thing: Repeating Group X list of A’s item #: Repeating Group X page number

Update:

Workaround 1: If I store the current A Thing in a custom state (using the same logic as mentioned in the Note above) and refer to this custom state when creating my B and setting the relationships, then everything works as expected - the relationship data gets stored to the database correctly.

Workaround 2: Same applies if adding a group outside the repeating group and setting it’s content to the repeating groups current page Thing (same logic as in Note). Referring to this groups’ thing when creating the relationships works too (relationships get stored to the database) - and for me is much better than workaround 1 as keeping custom states up to date with multiple related lists quickly spirals into a mess.

This topic was automatically closed after 14 days. New replies are no longer allowed.