qfieldcloud icon indicating copy to clipboard operation
qfieldcloud copied to clipboard

Virtual layers with QField Cloud

Open gabgarcies opened this issue 3 years ago • 2 comments
trafficstars

### Short description of problem

I am trying to configure a QGIS project with virtual layers but it does not synchronizes correctly to Qfield Cloud.

### Reproduction Steps:

I am working on a project for fieldwork in which a point feature (portal addresses) have N related records (households) on a related table. So that, when the user clicks on a portal address point, the N households show up.

image

Both features, with/without geometry, are loaded to Qfield Cloud as Geopackage files.

I have also created a virtual layer, based on a SQL query*, in order to symbolize the points in green (once all of its related households have been inspected by the fieldworker).

SQL query:

image

### Expected behavior:

I have tried the same workflow (with a simple case) and it works fine in the cloud and the app. The points update to color green when I collect data for the 100% of its related housholds records.

### Observed behavior:

In the project I want to implement, I think the issue might be in the query I mentioned before. In QGIS desktop it takes quite a lot to load every zoom in/out refresh. And the project, when I upload it to Qfield Cloud, stays in red color and cannot be downloaded to the app.

image

So, I have checked that virtual layers work with Qfield Cloud. Any ideas on how to improve the SQL query to achieve the same goal?

Thank you!

## Additional information:

  • Problem started happening recently, didn't happen in an older version of QField: [No]
  • Problem can be reliably reproduced, doesn't happen randomly: [Yes]
  • Problem happens with all files and projects, not only some files or projects: [No]

gabgarcies avatar Apr 04 '22 10:04 gabgarcies

Can you please share an example project where it does not work, so it can be easier to investigate. Also if you still have the project that worked would be great.

suricactus avatar Apr 04 '22 10:04 suricactus

Sure!

Now, I have noticed the example that works (simple case) has not any related table. The problem might come in cases in which I try to work with virtual layers and related tables?

EXAMPLE_WORKS_YES.zip EXAMPLE_WORKS_NO.zip

gabgarcies avatar Apr 04 '22 11:04 gabgarcies