roam-qgis / Roam

Simple data collection built using QGIS.
http://roam-docs.readthedocs.org/en/latest/
GNU General Public License v2.0
171 stars 61 forks source link

How to set up and use the inspect button? #416

Closed TonyFMCMC closed 5 years ago

TonyFMCMC commented 6 years ago

I want to use the inspect button to copy a selected polygon from a 'sites' layer to another layer 'amended sites', and open a form with some fields having data copied from the original sites polygon, and other fields populated with an expression. I have created two select layers, one on sites and one on amended sites, enabled only the inspection tool on sites, nominated a form I have created based on the amended sites layer called 'amended_sites_form' as the target form. I have set mappings from the sites layer to the amended sites layer. I have established that the fields to be populated with expressions must be set to 'Capture and save' on the amended_sites_form or else nothing is saved in these fields.

But when I select a polygon in sites,

  1. An edit button comes up in the info panel on the right which has puzzling behaviour: it opens a copy of the amended sites form, with the mappings but the default values. Yet when I save the form, it creates a polygon in the 'amended sites' layer with the default values in. How can I get the default values showing in this form?
  2. An inspect button comes up in the info panel, it doesn't open a form, but copies mapped data into a new polygon in the 'amended sites' layer, and puts the default values in also.

The behaviour I expected was that the inspect button would open a form as in 1) but would populate the fields on the form with the default values. It doesn't worry me that much that there are the two options, but it does worry me that I can't get the default values to show in the form in option 1 (even though they do get saved).

TonyFMCMC commented 5 years ago

I suppose another way to ask this is that I want to be able to create a sites layer entry, and attributes after selecting the relevant sites polygon and clicking on the edit button, but I also want to be able to 'inspect' the sites polygon to generate an entry in another table. Because the buttons are enabled in the select layer part of the Roam Config Manager (rather than in the form itself), I don't seem to be able to do both of these things in the one project. I think I have concluded that you have to create polygons in a layer in one project and inspect polygons in that layer in a different project. A bit of a pain if you have to switch between the two then pan around to find the relevant polygon.