Attribute Form - Element visibility controlled by expression with joined tables not working in QField

Hi all,
I have recently come back to using QField after a long break. Looks like a lot has changed and it is a much improved app. Great work to all the team!

I have been updating an old project and making it more useful and flexible for my needs. This includes making the attribute form more useable but also more complex. I want to use the project for field work (I am a land surveyor). It uses field codes and various options associated with those codes.

One of the things I have implemented is controlling the visibility of various elements based on expressions. These expressions utilise joins I have created to various tables within the QGIS project. Previously I had these expressions setup to use ‘hard-coded’ values. Now they are using values derived from the tables based on user-selected form options.

It is working well in QGIS itself but I cannot get this to work in QField (either locally or via QField Cloud) at all, without reverting back to the hard-coded values. I am using iOS, but I suspect it would be the same on Android - though I could be wrong! It is a bit frustrating (and perhaps I should have done some more testing before proceeding too far down this path?!), but if someone could help me out it would be much appreciated. I’m sure the methodology I’ve used may not be the best approach, but as it worked well in QGIS I assumed it would also work in QField.

For example, the user digitises a point then selects the appropriate field code. Different tabs become visible based on the code selected. The user fills in the form fields on each tab (some mandatory, some optional).

Have provided a couple of screenshots to help demonstrate the issue:

Initial form:

Different code selected - shows different tabs:

Joins:

Visibility control for ‘General’ tab:
"CodeOptions_CodeSystem" = "CodeSystem" and "CodeOptions_Code" = "Code" and "CodeOptions_Owner" = true or "CodeOptions_CodeSystem" = "CodeSystem" and "CodeOptions_Code" = "Code" and "CodeOptions_Material" = true or "CodeOptions_CodeSystem" = "CodeSystem" and "CodeOptions_Code" = "Code" and "CodeOptions_PoleDetails" = true or "CodeOptions_CodeSystem" = "CodeSystem" and "CodeOptions_Code" = "Code" and "CodeOptions_Fences" = true or "CodeOptions_CodeSystem" = "CodeSystem" and "CodeOptions_Code" = "Code" and "CodeOptions_SubTypes" = true or "CodeOptions_CodeSystem" = "CodeSystem" and "CodeOptions_Code" = "Code" and "CodeOptions_Signage" = true or "CodeOptions_CodeSystem" = "CodeSystem" and "CodeOptions_Code" = "Code" and "CodeOptions_RetWall" = true or "CodeOptions_CodeSystem" = "CodeSystem" and "CodeOptions_Code" = "Code" and "CodeOptions_QQ" = true

Happy to share the whole project as it is difficult to explain in detail here - if someone can tell me how to do that here (or elsewhere).

Thanks,

Ben


Imported from GitHub discussion by @Benwaa74 on 2024-08-14T03:26:59Z

Benwaa74 , can you make a reduce sample project and add it to this discussion ( github supports zipped attachments in comments).


Imported from GitHub comment by @nirvn on 2024-08-14T03:31:49Z

FYI… I am using the latest version of each software component:
QGIS;3.38.1
QField App:3.3.10
QField Sync Plugin: 4.10.1


Imported from GitHub comment by @Benwaa74 on 2024-08-14T03:32:51Z

Hi nirvn,
Project attached - have just zipped the whole project folder - it’s not very big!
fieldsurvey.zip


Imported from GitHub comment by @Benwaa74 on 2024-08-14T03:35:05Z

Tested and get the same, the expression works on the desktop but not on an iPad. I use similar setup which does work but my expressions are less complex and don’t involve joined data.


Imported from GitHub comment by @BTreeTech on 2024-09-02T14:14:00Z

BTreeTech , see Feature form should support dynamic form joins · Issue #5560 · opengisch/QField · GitHub .


Imported from GitHub comment by @nirvn on 2024-09-03T04:19:03Z