QField icon indicating copy to clipboard operation
QField copied to clipboard

Feature form should support dynamic form joins

Open nirvn opened this issue 1 year ago • 4 comments

QField should support joins with dynamic form enabled.

Discussed in https://github.com/opengisch/QField/discussions/5559

Originally posted by Benwaa74 August 14, 2024 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: image

Different code selected - shows different tabs: image

Joins: image

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

nirvn avatar Aug 14 '24 03:08 nirvn

@Benwaa74 , turns out QField does not yet support the dynamic form join option here:

image

It would be a nice thing to have in QField indeed, hoping the community will step up to support the development of this enhancement. Will it be you? :)

nirvn avatar Aug 14 '24 03:08 nirvn

Hi nirvn, Ok, that would explain it 😁 Thanks for checking it out for me. Much appreciated.

As much as I would love to do this, I'm not a developer or in a position to be able to devote time to it. Perhaps in time that will change, but I hope someone is able to take this on board and make it happen. As you say, it would be a very useful and powerful addition to QField!

Many thanks,

Ben

Benwaa74 avatar Aug 14 '24 04:08 Benwaa74

@Benwaa74 , no worries, there are plenty of ways to support QField. That includes providing documentation, which I see you've done in the past (https://github.com/Benwaa74/QField-docs/commit/038a4db101514ba053c70d89ce8638516eaf6c02), thanks for that!

If you are in a work environment that could sponsor the development, feel free to reach out to us via [email protected]

nirvn avatar Aug 14 '24 04:08 nirvn

Thanks nirvn.

Happy to help out with documentation when time allows.

Will make some inquiries at work to see if there's any interest/possibility of sponsoring this development - not holding my breath though 🙃

Benwaa74 avatar Aug 14 '24 04:08 Benwaa74