I have read the QField support on how to add a series of pictures to a feature. I've also read other threads and GIS Stack Exchange questions and answers on this: e.g., Setting QField for 1:n photos. However, I am still confused and unable to get this working properly and was hoping that someone could provide a detailed explanation that may help others in this process.
Step 1: I create the relation between the Referenced 'parent layer' (= Wetland Survey) and the referencing 'child layer' (= Wetland_pics):
I am not entirely clear on what 'uuid' actually is here. I know that it is a Universal Unique Identifier, but is this necessary? Why couldn't I use my site.code? I notice that using
site.code()as a default value gives an error, where
uuid() gives an identifier - so the system must recognize uuid for this function. This is not my primary question, but understanding this seems important in relation to the primary keys (not entirely sure of what they are).
Step 2. Building the form layout
a. Drag and Drop, set the uuid (parent relation):
b. Drag and Drop, set the Wetland Pictures (child relation):
Step 3. Setting drag and drop form in the child table ('Wetland_pics') - set path to attachment widget type:
Step 4. Testing the form:
The form looks fine, but I am unable to select or type anything in the "Wetland Pictures" fields in QGIS. I'm trialing the form in QField beta windows version (second image) and you can see that I get the message "Cannot add child feature: parent primary keys are not available". This is what leads me to suspect that this has something to do with uuid.