Skip to content

Set up the edit form in QGIS

Your team reads and changes the fields of each feature in Groundwork. In QGIS, you decide what each field shows and accepts. Open Layer Properties → Attributes Form and select the field. Each setting on this page is in the panel for that field.

In the QGIS User Guide: Attributes Form Properties.

What Groundwork reads

Groundwork reads these settings for a field:

Setting in QGISWhat your team sees in Groundwork
AliasThe alias in place of the name of the field, wherever your team reads or chooses the field
Widget Type set to HiddenNo sign of the field. The value stays in the data file
Widget Type set to Value MapA label in place of each stored code, and a list of the labels in the edit form
Widget Type set to Value RelationA name in place of each stored code, read from another table, and a list of the names in the edit form
Widget Type set to CheckboxA yes/no field that stores your checked and unchecked values
Widget Type set to RangeA number box that refuses a value outside the range when your team saves
Widget Type set to Date/Time, with a custom formatA date that Groundwork reads and writes in your pattern
Widget Type set to ColorA swatch of the colour beside its code, and a colour picker in the edit form
Widget Type set to Uuid GeneratorA new ID on each new feature, in a field that your team cannot change
Widget Type set to Attachment, with the Type of its Integrated Document Viewer set to ImageA photo on each related record, on a map in a Dropbox folder
Editable untickedThe value of the field, with no box to type in
Default value and Apply default value on updateA value that Groundwork fills in by itself
When adding features set to Reuse Last Entered Value, under PoliciesA new feature or record that starts with the value that the last one was given
Not null, Unique and Expression, under ConstraintsA refused save, or a notice under the field, when a value breaks the rule
When duplicating features, under PoliciesThe values that a copy keeps when your team pastes a feature into the layer that they copied it from
The layout of the form in the Drag and Drop Designer, with a group shown by an expressionA field that appears only while the expression is true, and the fields in the order of the layout. The tabs and groups are not drawn
The Data defined override button beside Editable, in the Drag and Drop DesignerA field locked in the edit form while the expression is false. The Editable box still locks the field when it is unticked
What Groundwork reads from the form layout

From the layout of the Drag and Drop Designer, Groundwork reads which fields the form places, their order and the visibility expression of each container. It does not draw the tabs and groups, and it ignores their titles, columns and collapsed expressions, the label styles and the relation editors. Some widget types change nothing in Groundwork, such as Relation Reference. Groundwork treats a field with one of these widgets as a field with no widget.

The functions and operators that an expression on this page can use are in Write expressions in QGIS.

Groundwork also reads the alias from QGIS Server. It reads every other setting on this page only from the project file, so a map connected to QGIS Server does not have them.

Choose how a field shows

Each choice in this section is a Widget Type for the field.

In the QGIS User Guide: Edit widgets.

Hidden

To hide a field from your team, set its Widget Type to Hidden. Groundwork does not show the field anywhere, but the value stays in the data file.

Value Map

To show your team a label in place of a short code, set the field’s Widget Type to Value Map. Then give each stored value its label, such as Good for G. Groundwork shows the label wherever your team reads the field, and the edit form offers the labels as a list. The data file keeps the code.

Value Relation

To offer the names from another table, such as a table of asset types, set the field’s Widget Type to Value Relation. Choose the table in Layer, the column that the field stores in Key column, and the column to show in Value column. Groundwork shows the name wherever your team reads the field, and the edit form offers the names as a list. Tick Allow NULL value to add a blank choice, and use Order By and Descending order to set the order.

Tick Private for the table in Project Properties → Data Sources, under Layer Capabilities, to keep it off the map. Groundwork reads the table from a file in a cloud folder or a dropped project, and only in GeoJSON, GeoParquet, FlatGeobuf, GeoPackage or CSV. It does not read Allow multiple selections. To narrow the list by what the form holds, write a Filter expression that uses current_value. For example, "family" = current_value('family') offers the rows of the table whose family matches the form’s family field.

Add a column named icon to the table. In each row, enter the name of an icon from Tabler Icons, such as tabler:alert-triangle beside Poor. Groundwork shows the icon beside the name in the details, the edit form, the feature list, the filter and search. QGIS ignores the column.

Checkbox

To store a yes/no answer as Y and N, or as 1 and 0, set the field’s Widget Type to Checkbox. Give it a Checked state and an Unchecked state. Groundwork then treats the field as yes/no and writes those values. If Allow NULL representation is unticked, the edit form shows a tick box.

Range

To limit a number to a range, set the field’s Widget Type to Range. Give it a Minimum and a Maximum, and a Step for the arrows. Groundwork shows the range under the box in the edit form and refuses a save outside it.

Date/Time

To keep a text field’s dates as 23/10/2026, set the field’s Widget Type to Date/Time. Tick Overwrite Field Format, choose Custom in its list and enter a pattern such as dd/MM/yyyy. Groundwork reads and writes the field in that pattern, sorts it by date and shows it as “23 Oct 2026”.

Color

To show a colour as a swatch, such as the colour of an annotation, set the field’s Widget Type to Color. Groundwork fills the field’s box with the colour in the details, and shows a swatch in the feature list where the list shows the field. The edit form offers Groundwork’s set of colours to pick from and keeps a colour from outside the set until your team picks another. Groundwork stores a code such as #ff0029, which QGIS reads.

Show an icon beside a field

To show an icon beside a field’s name, such as a wheelchair beside Accessible, give the layer a variable. The icon comes from Tabler Icons, the set of icons that Groundwork uses.

  1. Find the icon on tabler.io/icons and copy its name, such as wheelchair.
  2. Open Layer Properties → Variables.
  3. Click the Add variable button. QGIS adds a row to the layer’s variables.
  4. Name the variable quac_icon_ followed by the field’s name, such as quac_icon_accessible. Use the field’s name, not its alias.
  5. Enter tabler: and the icon’s name as the value, such as tabler:wheelchair.
Where the icon shows

Groundwork shows the icon in the colour of the field’s name. It appears before the name in the details and the edit form. In the sort menu, the filter and the layer’s field lists, it takes the place of the icon for the field’s type. Groundwork loads each icon from jsDelivr, a public site that serves the Tabler files. If an icon does not load, such as a name that Tabler does not have, the details show the name alone.

QGIS shows no icon in its own form. If you rename the field, rename its variable too.

In the QGIS User Guide: Variables properties.

Show a field’s choices as buttons

The edit form offers a Value Map’s or Value Relation’s choices as a list that opens. To show them as buttons, so your team chooses with one tap, give the layer a variable. For example, Condition then shows Good, Fair and Poor side by side.

  1. Open Layer Properties → Variables.
  2. Click the Add variable button. QGIS adds a row to the layer’s variables.
  3. Name the variable quac_control_ followed by the field’s name, such as quac_control_condition. Use the field’s name, not its alias.
  4. Enter buttons as the value.
How the buttons look and behave

Groundwork shows every choice as a button, however many the list holds, so keep buttons for short lists that will stay short. The buttons sit side by side where their names fit. Where they do not, they sit in two columns, and then one under the other. If the choices have icons, each icon sits above its name, or beside it when the buttons are one under the other.

To clear the field, your team taps the chosen button again. A field with an enforced Not null constraint cannot be cleared. The buttons show only while your team edits. The details show the chosen name, as before.

A field whose list also accepts a value typed by hand, such as a style category with all other values, keeps the list.

A value of dropdown keeps the list. QGIS has no such setting and shows a list in its own form. If you rename the field, rename its variable too.

Show a field only when another field says so

QGIS has no visibility setting on a single field, but it has one on a group. To show Repair notes only for an asset in poor condition:

  1. Set the form to Drag and Drop Designer in Layer Properties → Attributes Form.
  2. Add a group to the layout, and drag repair_notes into it. Do not put any other field in that group.
  3. Untick Show label for the group, so that the form shows the field alone.
  4. Tick Control Visibility by Expression and write "condition" = 'P'.
  5. Drag every other field into the layout. Groundwork leaves out a field that the layout does not place.

In Groundwork, the field then appears in the details and the edit form while the expression is true. In the edit form, it appears or disappears as your team changes Condition. Groundwork does not check a field that is hidden this way when your team saves. A Not null field in a hidden group does not stop the save. The value stays, and Groundwork saves it as it is.

In the QGIS User Guide: Attributes Form Properties.

Lock a field

In the QGIS User Guide: General options.

Editable

To stop your team changing a field, untick Editable for the field. While your team edits, the field shows its value but has no box to type in. Your team can still change the other fields of the layer.

Data defined override

To lock a field only at times, use the Data defined override button beside the Editable box. Choose Expression → Edit… and enter an expression, such as "last_inspected" IS NULL for a field that stays editable until an inspection date is entered. While the expression is false, the field is locked in the edit form, and it unlocks when the expression is true again. Groundwork reads it only when the form is set to Drag and Drop Designer.

Fill a field by itself

In the QGIS User Guide: Default values and General options for Reuse last entered value.

Default value

To keep a Last edited date on a layer, select the date field. Then:

  1. Untick Editable, so that no one can change the date in Groundwork.
  2. Set Default value to now().
  3. Tick Apply default value on update.

Groundwork then writes today’s date into the field each time someone adds or changes a feature. While your team edits, the field shows its date but has no box to type in.

To give each new feature an ID, set Default value to uuid(), or give the field the Uuid Generator widget. To start a field on a value, such as 'Good', set Default value to that value. A pasted feature keeps the ID or value it was pasted with. The exception is a field ticked Unique, when another feature already holds the value. To fill a field from other fields, set Default value to an expression such as upper("suburb").

Use make_interval, such as "inspected" + make_interval(days:="days_to_comply"). Untick Editable and tick Apply default value on update to keep that date in step as someone changes the form, and at each save.

To fill a field such as a property number from the feature of another layer, use overlay_within, such as array_first(overlay_within('Properties', "prop_propnum")). Untick Editable and tick Apply default value on update, so that the field follows the point when it moves.

Reuse Last Entered Value

To save your team typing the same value again, such as an inspector’s name, set When adding features to Reuse Last Entered Value, under Policies. Each new feature or record then starts with the value the last one was given, and your team can change it. Groundwork keeps the value in the browser on that device.

Set the rules that a value must meet

In the QGIS User Guide: Constraints and Expressions.

Not null

To require a value in a field, tick Not null under Constraints. Also tick Enforce not null constraint to stop a save while the field is blank. Leave it unticked to save the blank field and show a notice under it.

Unique

To keep a value from appearing twice, such as an asset ID, tick Unique under Constraints.

How Groundwork replaces a repeated value

Say a new feature or record arrives with a value that another one holds. It then takes the field’s Default value, or else a generated one. A number becomes the largest held plus one, and PA-001 becomes PA-001_1.

Tick Enforce unique constraint to stop a save that would give two the same value. Leave it unticked to save it and show “Another feature has this value.” under the field. Groundwork checks only the features it has loaded, so a WFS layer is checked against the view on screen.

Expression

To refuse a value that breaks a rule between fields, type the rule in Expression under Constraints, such as "last_inspected" IS NULL OR "last_inspected" >= "installed". Put the sentence your team should see in Expression description. Tick Enforce expression constraint to stop a save that fails the rule. Leave it unticked to save it and show the sentence under the field. A field left empty fails a rule that does not allow for it, so start a rule on an optional field with "field" IS NULL OR.

Next: Link records to a feature.