-
-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible regression of QField when using Boolean type fields #5214
Comments
Can you provide a minimal project with as little attributes and layers as possible to reproduce this behavior? |
For the record I suspect it's this upstream regression that got fixed not too long ago: |
@m-kuhn I made a sample project and attached it here. The sample project contains an Employee layer with two columns for their active status. One column is a boolean type, and the other is an integer. When you select the fieldnotes layer and create an entry, go to the Crew tab, and select a region in the Team dropdown, the boolean box will remain empty, while the integer box will display values. Also, this only happens in QField but not in QGis itself. I hope this helps! |
In QField v3.2.2 and QGIS v3.36.2, I was unable to reproduce the issue you are experiencing. |
Hi @SeqLaz I just looked at the pdf you uploaded maybe I wrote the instructions a little confusing. You used the employees layer but the crew selection actually happens in the "fieldnotes layer". (People usually don't see the Region and Employees layer - both layers are usually invisible) See the three screenshots below
the boolean field combo box remains empty. If you go to the properties of the layer and look at the widget setup both boxes are identical with the only difference that the top one utilizes a boolean type field while the one at the bottom uses an integer |
Hello @Meykaefer, I understand now, the issue is not with QField. The problem lies in the expression you are using. You have used the string 'true' instead of a boolean type. For a boolean, you need to follow the SQL language convention and use True or TRUE, without any quotation. You will notice that in the expression editor, the boolean type is highlighted with a different color than strings. To fix the issue, you just need to change the string to a boolean type. |
Hi @SeqLaz, Thank you for figuring this out! Nonetheless, I do think something changed somewhere along the line. I have field projects that from December which are set up identical to the sample I provided and I was able to record the crew on site. And once we returned from the winter break it all of a sudden didn't work anymore. That is the reason I thought it could be a possible regression since something that previously worked stopped working. Thank you for pointing out the reason and providing a solution! |
@Meykaefer , can you try the sample project that stopped working against the APK here: #5216 (comment) ? Thanks |
@nirvn , I would gladly test the APK, but I don't know how to do it. I only have access to iOS devices, and I don't know how to install this APK. If you have some instructions on what I need to do I can do and test it. |
Hey @nirvn It is not possible to use a string 'true' as a replacement for a True type value when using the compiled version of QField and the original project shared by @Meykaefer. |
During recent fieldwork, colleagues encountered an issue with our QField project. Our project has a list of staff members, and each member is assigned a status indicating whether they are already active during the season. This status was used to filter the results in the value relationship widget, and only active staff (i.e., 'true') were shown in the combo box for selection, while inactive staff ('false') were hidden. This worked very well last year at the end of the season, but after returning to the field, we don't get any results in the box that usually lists staff. I replaced the boolean type field with an integer and assigned two values: 1 for true and 2 for false. After changing it to an integer value, the combo box shows the staff as it was by the end of last season.
Expected behavior
Expected behaviour is that QField would utilise the boolean type field values.
Observed behavior
The boolean type fields work in QGis but not in Qfield. Replacing boolean-type field values with integer values allows it to work in QField
Desktop (please complete the following information)
Mobile (please complete the following information)
Additional information
The text was updated successfully, but these errors were encountered: