Filtering Relationship Choice by Row ID in Self-Referential Hierarchy Does Not Work

Continuing the discussion from Filtering Relationship Choice by Row ID:

This app demonstrates the problem(s) and a workaround:

Filter by Row ID does not appear to work in a self-referential structure.

Reproduced in a modified version of the Things template app.

Things have Row IDs.

Things can contain three other things but must not contain themselves.

Choice for the 1st thing is filtered by Name.
Choice for the 2nd thing is filtered by a Row ID
Choice for the 3rd thing is filtered by a setting from Column Value Row ID.

This demonstrates two problems with filtering in self-referential structure and demonstrates a workaround for one.

(a) Filtering by Name is unsafe because Name is volatile. Steps to reproduce:

  1. Edit the Thing named ‘Bloko’
  2. Note there are three contained things in Bloko
  3. Activate ‘Relation Filtered by Name’ Choice drop-down and note that ‘Bloko’ is correctly filtered from the Choice.
  4. Click ‘Done’ to return to edit screen.
  5. Edit Bloko name so it is distinct but recognisable, e,g, ‘Bloko Bloko’
  6. Activate ‘Relation Filtered by Name’ Choice drop-down again and note that ‘Bloko Bloko’ is NOT filtered from the Choice.
  7. Choose ‘Bloko Bloko’.
  8. Edit ‘Bloko Bloko’ back to ‘Bloko’.
  9. Note you have now bypassed the filter and created a self reference.
  10. Note also that in the Edit Screen the ‘Relation Filtered by Name’ Choice is now blank even though it is in the data table

(b) Simply Filtering by Row ID does not work at all. Steps to reproduce:

  1. Edit the Thing named ‘Bloko’
  2. Activate ‘Relation Filtered by Row ID’ Choice drop-down and note that ‘Bloko’ is INCORRECTLY NOT filtered from the Choice.
  3. Choose ‘Bloko’.
  4. Note you have now bypassed the filter and created a self reference.

WORKAROUND is to filter by a copy of Row ID. Row ID is brought into the screen as a Value from Screen that sets a column value Row ID Filter and this is used to in ‘Filter by Column Value set Row ID’.

  1. Edit the Thing named ‘Bloko’
  2. Activate ‘Filter by Column Value set Row ID’ Choice drop-down and note that ‘Bloko’ is correctly filtered from the Choice, so filtering works and …
  3. Editing the Name is now safe because it will not reveal the same records Row ID in the Choice.
2 Likes

For some unknown reason the labels on the Choice Component all reverted to their defaults. I have recreated the labels used in the steps to reproduce above.