Update on mobile deletes item on desktop

Hi -

I’m working on a project where I’m trying to walk all the streets in my town. I want to be able to update things from my phone as I’m out and about.

I have three layers in my QGIS file -
streets_segments - all the street segments in my town (this includes a field called “completed” which is zero if not and 1 if it is)

streets_completed - a filtered version of streets_segments with only those with a 1 value for the “completed” field

streets_remaining - a filtered version of streets_segments with only those with a 1 value for the “completed” field

On QGIS when I want to update a segment, I select it in either streets_segments or streets_remaining, open the attribute table, open the field calculator, and update the “completed” field value to 1 only for the selected segment. That updates the value in streets_segments and shifts the segment from streets_remaining to streets_completed, exactly as I want it to do.

I package this up, sync it to the cloud version of QField, and go get it on my phone.

All seems well, - I can open it, move around, see which segments are completed and which are remaining.

But I run into trouble when l try to update a segment’s “completed” field on my phone. I can select that segment, and it lets me choose whether to edit it in streets_segments or streets_remaining.

Whichever one I choose, I edit the data and change the “completed” value from 0 to 1, and sync. On QGIS on my computer, the segment disappears from streets_segments and it stays in streets_remaining, rather than moving to streets_completed.

Should I be using another method of updating the record on my mobile? Is something off with filtering on the mobile or as part of a QField sync?

Thanks in advance for any help!

I’ve made a small test project on QGIS to check this. It is as follows:

  • A geopackage file with only one point layer. I only added one field to this layer, of type boolean to represent your “completed” field.
  • Ctrl + D to duplicate the layer on the project two times, one for showing the “trues” and another to show the “falses”. Keep in mind that this still references to the same, one and only geopackage. The original layer still shows, behind both these layers.
  • Right click on duplicated layers > Filters… . On each, a simple “boolean” = true or false filter expression, accordingly.
  • Tried creating a couple of points with random true or false values. The filtered layers properly show only their corresponding points, updating instantly.

I then created a new QField project using this project as a base. Making changes on a mobile device and then synchronising the projects back and forth works as expected: when I change from a false to a true value, the duplicated filtered layers properly update, both in QField and QGIS.

When you say “rather than moving to streets_completed", what do you mean by “moving”? are you doing a more complex duplication or filtering than what I’ve described?

Thank you so much for going to this length! What you’ve described is a mini-version of what I did - original layer with all segments, duplicated twice and filtered each, one for “1” and one for “0”.

What I mean about “moving” upon updating the filtered field is that a segment that is listed in “streets_remaining” should disappear from that layer and appear in “streets_completed.”

I may try Boolean (vs. the current 0/1) to see if that helps. Maybe it is as simple as that?

Also, maybe I’m somehow doing the sync wrong? I’m updating on mobile, syncing there, and then syncing on desktop by bringing down the cloud versions of the files that updated. I think I’m doing it right, but maybe I’m missing a step or doing things out of order?

Thanks so very much for your help already!

ooh, I see, then it should work. Try changing to boolean and lets see.

Maybe you’ve mixed up the layer names when you duplicated them? It might be working correctly, but the filters are in a wrongly named layer?

I started over from just streets_segments and made a Boolean field and made new layer duplicates and designated them based on whether the Boolean field was true or false.

Same thing happens as before. It’s like the streets_segments data are completely separate from the streets_remaining data on QField, even though they’re supposed to be looking at the exact same data source.

I don’t have bandwidth to troubleshoot this any more. I’m going to have to just keep track manually while I’m walking and manually update my data on my desktop as I go. Thanks for the help all the same.

Ouch, sorry to hear that. If you can and want, maybe you can upload at least a snippet of your project so I can try to see if I find anything that could be misbehaving.

Good luck!