How to insert new data into a one-to-many relationship

I have a Qfield project with a one to many table relationship. One layer with point geometry (sampling plot) and one without geometry (trees). I see that this is possible: Problems inserting new data into a one-to-many value relationship in Qfield 2022. · opengisch/QField · Discussion #2993 · GitHub

However, I don’t know how I have to configure the QGIS project in order to be able to insert new data to the trees table in QField. In the QGIS project, I joined my trees table to the sampling plot layer, but this doesn’t work.


Imported from GitHub discussion by @Barbara-Schneider on 2025-01-15T11:57:14Z

Hi Barbara-Schneider,

For working with this workflow described, you need to configure a relation of layers (in your case, the point and the trees table). In the project properties, for the field relation, it is highly recommended to use a string field with UUID. You have two options for creating UUID values:

  1. You can use the “UUID Generator” widget, which will automatically generate unique UUID values for each entry.
  2. Alternatively, you can use the “Text Edit” widget and manually generate UUID values using the uuid() expression.

For more reference on how to configure this, check the following documentation:


Imported from GitHub comment by @SeqLaz on 2025-01-15T18:01:25Z

Hi SeqLaz,
thank you very much, this works!
Barbara


Imported from GitHub comment by @Barbara-Schneider on 2025-01-16T09:58:06Z