4

I'm using QGIS 3.12 on Win10 x64.

I'm trying to configure QField for 1:n photos. I have a point layer representing trees, and I want to be able to add multiple photos to that pt. I have set up as follow.

Layer ptTree has a unique field 'uuid'. Layer photo has a unique field also 'uuid' and a foreign key field 'fkid'.

I have created a relation between the two, as in the image below:

Relation Settings

I have then configured the photo form as in the images below: first image shows the settings for the field 'uuid', second for the field 'fkid' and third for the field 'path'.

uuid field

fkid field

enter image description here

On this last image for the 'path' field, I think I have set 'relative paths' correctly, but I can't find any guidance on 'display resource path', or if you scroll down on the 'widget type' settings, there is also settings for 'Integrated Document Viewer' - this is hidden in the picture, but I have this set to 'no content' - I've tried 'image' but this does not seem to work.

In the form settings for the ptTree layer, I have the cardinality for the ptTree-photo widget set as 'Many-to-one' as in the image below.

enter image description here

In QField, when editing the ptTree layer, I get an add button to add a picture. I can then click the camera icon to bring up the camera. I can then take a picture, and press OK to accept and a record is created. But no path information is entered, and I cannot see a thumbnail of the picture. This was previously working on the same hardware (Galaxy Tab S4) so it's not a hardware issue.

Can anyone see what I may be doing wrong?

2

I think the problem is your configuration of your referencing (child) layer "photo". your screenshot shows how you configured the uuid field of this layer, but that does not really matter. important is how you configure your "fkid". there you should set the widget type to "relation reference" , and set the display expression to your relation ("photo_718_fkid....")

your "path" field seems to be correctly configured, although I indeed use under "integrated Document Viewer" the type "Image"

4
  • Thanks for your input. I can see that should help, but I've not got it working yet. I think I will build from scratch again to see what issue is 'breaking' it. Thanks again. – Oisin Jun 30 '20 at 8:06
  • 1
    with the newest version of QField Sync, there is a new "tab" called "Photo naming". Does your configured layer/column appear there? I'm having a project in QGIS for the same topic (trees and measurements to take to keep them healthy etc) if you like, i can send you the project, maybe you find your error comparing it to that one? – sn1ks Jun 30 '20 at 9:54
  • Yes please. I can send you mine too. You might find my geometry generator for crown spreads and Root protection Areas of interest. How do we share, privately or in public domain? – Oisin Jul 1 '20 at 10:13
  • sorry for my late reply. i do not mind sharing it in public domain, but i have to translate the project first (it is currently in german) i will let you know once i found the time to do that! :) – sn1ks Jul 14 '20 at 6:13
2

So, I've found the cause of the issue: [Project properties]_[Project Home] must be blank.

Also: No need to set the 'Referencing Field' (aka foreign key, i.e. fkid in my example) to a Relation reference. I have Relation set to 'Association' strength - I have not tested 'Composition' strength.

O

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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