I have a no-geometry layer 'pictures' linked to several different parent layers. This means the project can have multiple photos attached to a point and all the photos for the project can be viewed at once within QGIS alongside their attributes.

I am trying to figure out if I can automatically add the source layer name to the pictures in the child layer. E.g. If 'Layer 1' is the parent and I take attach a photo to it via the relationship with 'pictures' then it will automatically fill in a field on the 'pictures' layer with 'Layer 1'.

I understand that I can use get_feature to target a map layer and then extract a value from the parent layer this way but is there any other way of accessing the parent layer that would allow me to pull the layer name instead?

  • 2
    No one has multiple parents. However you can mix different children in a single table. That is called a polymorphic relation. If that is the case, you must put the name of the parent layer in an attribute of the child in question. This is done by linking each parent to its children from the parent table. Please read the following docs link and clarify if this is the case for you, and if you have any difficulties in defining the relationship or linking child features: docs.qgis.org/3.22/en/docs/user_manual/working_with_vector/… Commented Jul 21, 2022 at 5:05

1 Answer 1


To attach multiple photos to a single feature, you can read the official documentation. The solution is based on 1:N QGIS relation with UUID fid field. Mergin Maps has unique widget in the mobile app to display gallery of your attached pictures.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.