Skip to content

Commit 06deda7

Browse files
committed
add warning - do not remove the fk from the form
1 parent d84e6e0 commit 06deda7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/layer/relations/index.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,18 @@ A new child feature can be added by tapping the **+** button:
128128
The referencing (child) layer **amenities** can also have the relation added to the attributes form.
129129

130130
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.
132132

133133
Choose **Relation Reference** as **Widget Type**:
134134
- **Display expression** sets the display name of referenced layer (here: `name`)
135135
- **Relation** offers all available relations defined in the project (here: `park-amenities-relation`)
136136

137137
![QGIS attributes form relation reference setup](./qgis-form-child-setup.webp "QGIS attributes form relation reference setup")
138138

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+
139143
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**.
140144

141145
In this case, the link between the amenity feature and the park can be set (or edited) manually.

0 commit comments

Comments
 (0)