You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/layer/relations/index.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,14 +128,18 @@ A new child feature can be added by tapping the **+** button:
128
128
The referencing (child) layer **amenities** can also have the relation added to the attributes form.
129
129
130
130
1. Navigate to the **Attributes** form tab in **Layer Properties**
131
-
2. Select the foreign key field (here: `fk-uuid`) in the list of fields.
131
+
2. Select the foreign key field (here: `fk-uuid`) in the list of fields. If you use the [Drag and Drop Designer](../form-layout/#qgis-drag-and-drop-designer), you may need to add the field to the form.
132
132
133
133
Choose **Relation Reference** as **Widget Type**:
134
134
-**Display expression** sets the display name of referenced layer (here: `name`)
135
135
-**Relation** offers all available relations defined in the project (here: `park-amenities-relation`)
136
136
137
137

138
138
139
+
::: warning Do not remove the foreign key field from the form
140
+
To ensure the setup works correctly, do not remove the foreign key field from the form. If you do not want to display the foreign key field in the form, set the **Widget Type** to **Hidden**.
141
+
:::
142
+
139
143
In QGIS, the attributes form of the referencing (child) **amenities** layer looks like this. The foreign key field `fk-uuid` offers a drop-down menu with the list of features from the referenced (parent) layer **parks**.
140
144
141
145
In this case, the link between the amenity feature and the park can be set (or edited) manually.
0 commit comments