Saltar a contenido

Attribute Form

Configure feature attribute forms in your QGIS project before performing fieldwork. Form configuration in QGIS for QField operates similarly to standard QGIS projects, with specific mobile optimizations.

Configuración del formulario de atributo

To configure an attribute form, open vector layer properties by navigating to Vector Layer Properties... > Attribute Form in QGIS.

Select appropriate widget types based on the expected behavior of each attribute. The table below summarizes attribute widget types supported in QField.

Below is an overview what widget types are available and supported in QField.

Tipo de control Soporte Notas
Adjunto Este campo se combina con la integración de la cámara, para obtener más información, vaya a Adjunto (configuración de fotos)
Color
Fecha / Hora
Caja para marcar
Oculto
Rango Cuadro giratorio y control deslizante editables
Editor de relaciones
Referencia de relación
Edición de texto
Mapa de valores Cuadro combinado o botón de opción (este último exclusivo de QField)
Relación de valores Cuadro combinado o botón de opción (este último exclusivo de QField)
Generador de UUID

QField also supports container widgets:

Tipo de control Soporte Notas
Widget QML
Widget HTML
Widget de texto
Widget espaciador

Para otros tipos de widgets de atributos que aún no son compatibles, considere patrocinar una implementación.

Configuración general de atributos

Project Manager

Configure general form options in QGIS under Vector Layer Properties... > Attribute Form:

  • Drag and drop designer": Organize form layouts using containers such as tabs and groups. Incorporate conditional visibility rules and default values to enhance form interactivity. Read more in the QGIS Drag and Drop Designer Documentation.

  • Ocultar formulario de atributo al: Puede ocultar el formulario de atributo cambiando de "Mostrar formulario al agregar función" a la configuración "Suprimir formulario de atributo". Al agregar una nueva característica en QField, no es necesario completar ningún formulario de atributo. Nota: En tal caso, debe configurar el formulario de atributos de tal manera que se cumplan todas las restricciones/reglas incluso si no agrega ningún atributo.

  • Editable: Puedes decidir si un campo es editable o no activándolo en la visualización del widget del campo correspondiente.

  • Recordar los últimos valores: Si no desea agregar el mismo valor una y otra vez, puede habilitar esta opción en la visualización del widget en QGIS. Sin embargo, QField ofrece un control más detallado sobre los últimos valores utilizados. Si habilita esta opción en QGIS, la regla siempre se aplicará. Con QField puedes cambiar y deshabilitar esta opción en cualquier momento durante la recopilación de datos.

  • Default values": Pre-fills attribute fields using QGIS expressions. QField supports positioning variables (such as GNSS variables) and QFieldCloud variables.

Formulario de atributos generales
Formulario de atributos generales

Feature Form Wizard Mode

QField supports Wizard Mode for feature forms containing multiple root tabs. When enabled, forms transform into a step-by-step, linear sequence.

Wizard Mode provides a guided workflow for field workers filling out complex forms, enforcing data constraints sequentially across form pages.

Note

Wizard Mode requires organizing form fields into multiple tabs.

Configuring Wizard Mode

Project Manager

Organize your feature form into tabs using the Drag and drop designer in QGIS before enabling Wizard Mode.

Flujo

  1. Open your project in QGIS.
  2. Navigate to Project > Properties... > QField or click the settings icon in the QFieldSync panel.
  3. Enable Enable QField feature forms' wizard mode.
  4. Save your project and synchronize it to QFieldCloud.

Using the Wizard in the Field

Trabajo de campo

When opening a feature form with Wizard Mode enabled, the interface displays one tab page at a time.

Navigating Pages: A navigation bar appears at the bottom of the attribute form:

  • Previous page / Next page: Navigate through form tabs sequentially using the navigation buttons.
  • Progress Ring: Displays form completion progress between navigation buttons.

Constraint Validation:

Wizard Mode evaluates QGIS form constraints on a page-by-page basis:

  • Visual Feedback: Progress indicators and navigation buttons change color based on validation status. Indicators turn red when hard constraints fail and yellow or orange when soft constraints trigger warnings.
  • Blocking Progression: Failing a hard constraint displays an error message ("Hard constraints not satisfied") and blocks navigation to subsequent pages until corrected.

Saving the Feature:

Wizard Mode hides the top-right Save button.

  • On the final form page, the Next page button transforms into a Save button.
  • Tapping Save evaluates form constraints one last time, commits the feature, and displays a confirmation message ("Changes saved").

Trabajando con las relaciones

Project Manager

For detailed information on setting up layer relations in QGIS, refer to the QGIS Relations Documentation.

Configuración del widget Mapa de valores

Control automatic transitions from button interface displays to scrollable lists when configuring Value Map widgets.

QFieldSync Layer Properties
QFieldSync Layer Properties

Flujo

  1. Navigate to Vector Layer Properties... > QField.
  2. Under Feature Form Settings, enable the option and set the maximum item threshold to trigger toggle button interfaces.

QField Value Map Editor as List
QField Value Map Editor as List

QField Value Map Editor as Buttons
QField Value Map Editor as Buttons

Widget de archivos adjuntos

Project Manager

The Attachment widget stores file paths for feature media and documents.

Use the Attachment widget to:

  • Capture photos or select pictures from the gallery.
  • Record audio clips.
  • Record video files.
  • Link external documents (such as PDF files).
  • Draw sketches directly in QField.

Imagen adjunta al formulario
Imagen adjunta al formulario

Audio del archivo adjunto del formulario
Audio del archivo adjunto del formulario

Video adjunto de formulario
Video adjunto de formulario

Note

Set attachment file paths to relative. QField stores media files in project subdirectories referenced by text attribute fields.

Tap the camera, video, microphone, or document icon to add media attachments. QField displays the default media button configured in QGIS inside the attribute form.

Media
Media

Copy media subdirectories when synchronizing projects manually.

QField displays file names for document attachments by default. Enabling the Hyperlink option on Attachment widgets displays file paths as external hyperlinks.

Setting a Specific Attachment Path

Project Manager

Configure media attachment file paths in QFieldSync. By default, QField saves photos to DCIM, audio recordings to audio, and videos to video using timestamped file names.

Flujo

  1. Navigate to Vector Layer Properties... > QField.
  2. Configure attachment file naming expressions under Attachments Settings.

Paths
Paths

Widget de relación de valores

Project Manager

The Value Relation widget displays values from a related layer in a combobox or toggle button layout.

The Value Relation widget supports toggle button interfaces similar to Value Map widgets.

Configure the following parameters:

  • Layer: Select the layer containing lookup values.
  • Key column: Select the attribute column containing saved key values.
  • Value column: Select the attribute column displaying readable labels during data collection.
  • Order by Value: Sort displayed values by key, value, or a specified column.
  • Group column: Group lookup values using another attribute column (such as grouping tree species by genus). When grouped, QField displays the widget as a list regardless of toggle button settings.
  • Allow NULL value: Allows leaving the field blank.
  • Use Completer: Enables auto-complete searching across available lookup values.
  • Allow multiple selections: Allows selecting multiple lookup values for a single feature.

Group Value Configuration

Project Manager

Flujo

  1. Select the attribute column used to organize items into groups.
  2. (Optional) Enable Display group name to display group titles as distinct section headers.

First configuration
First configuration

Second configuration
Second configuration

Third configuration
Third configuration

Different configurations on QField
Different configurations on QField

Use Auto Complete

Project Manager

Flujo

  1. Navigate to Vector Layer Properties... > Attribute Form.
  2. Set the widget type to Value Relation.
  3. Enable Use completer.

Enable auto-complete within QGIS
Enable auto-complete within QGIS

Trabajo de campo

Auto-complete in QField
Auto-complete in QField

Visibilidad condicional

Project Manager

Hide form containers or fields based on QGIS expressions. Use conditional visibility when specific attributes are required only under certain conditions.

Example: Disease Attribute Visibility

Flujo

  1. Create a container group in the attribute form designer.
  2. Define a visibility expression for the group (for example, display the group only when a feature is marked as sick).
  3. Add conditional attribute fields into the container group.

Configuration of a group box that will only be shown if the checkbox "disease" is checked.
Configuration of a group box that will only be shown if the checkbox "disease" is checked.

Trabajo de campo

Conditional Row Styling

Project Manager

QField supports QGIS conditional row styling to provide visual feedback in list views (such as identify results or relation lists). Use expressions to change background colors, text colors, and font styles based on feature data.

Note

QField supports full row styling in feature lists.

Flujo

  1. Open your project in QGIS.
  2. Right-click your vector layer in the Layers panel, select Open Attribute Table, and click Conditional Formatting.
  3. Switch to the Full row tab at the top of the Conditional Formatting panel.
  4. Click New Rule.
  5. Enter an evaluation expression (such as "status" IS 'Good').
  6. Configure visual formatting options:
    • Background color
    • Text color
    • Font styles (Italic, Underline, Strikeout)
  7. Click Done to save the rule.
  8. Save your QGIS project and synchronize it to QField.

Trabajo de campo

When viewing feature lists in QField (such as identify results or relation lists), items automatically apply defined conditional formatting rules.

Definir Restricciones

Project Manager

Attach expression rules as attribute constraints. Features require satisfying all constraints before saving edits. Add custom description messages to inform users when constraints fail.

Configuración de una restricción dentro de un rango
Configuración de una restricción dentro de un rango

Examples of constraint expressions:

  • Restrict elevation values:
    "elevation" < 5000
    
  • Require non-null identifiers:
    "identifier" IS NOT NULL
    

Definir Valores Predeterminados

Project Manager

Configure default values to pre-fill attribute forms when digitizing new features. Default values remain editable in the form unless fields are locked.

Configuración de una fecha formateada como valor predeterminado
Configuración de una fecha formateada como valor predeterminado

Attention

Avoid enabling Apply default value on update for primary key fields.

Working with Expressions

Use Layer Names rather than Layer IDs when building expressions for QField. QFieldSync conversion jobs may assign new internal Layer IDs, causing expressions referencing static Layer IDs to fail. Referencing Layer Names ensures consistent expression evaluation across project exports.

Uso de nombres de capas en expresiones
Uso de nombres de capas en expresiones

Additional Variables

Read the GNSS Positioning Documentation to store location details in attributes.

QFieldCloud provides three expression variables for attribute default values and conditional visibility:

  • @cloud_username: Returns the username of the logged-in QFieldCloud account.
  • @cloud_useremail: Returns the email address of the logged-in QFieldCloud account.
  • @cloud_team - Returns the name of the Team to which the user belongs within the organization.

Examples of expression variables:

  • Insert horizontal accuracy:
    @position_horizontal_accuracy
    
  • Insert current timestamp:
    now()
    
  • Insert digitized geometry length:
    length($geometry)
    
  • Insert custom device variable:
    @operator_name
    
  • Assign region codes based on spatial intersection:
    aggregate( layer:='regions', aggregate:='max', expression:="code", filter:=intersects( $geometry, geometry( @parent ) ) )
    
  • Transform positioning coordinates to project CRS:
    x(transform(@position_coordinate, 'EPSG:4326', @project_crs))
    y(transform(@position_coordinate, 'EPSG:4326', @project_crs))
    
  • Extract snapped feature attributes:
    with_variable(
      'first_snapped_point',
      array_first( @snapping_results ),
      attribute(
        get_feature_by_id(
          @first_snapped_point['layer'],
          @first_snapped_point['feature_id']
        ),
        'id'
      )
    )
    

Definir controles QML

Project Manager

Integrate custom QML widgets to execute advanced form actions.

Example

A QML button widget for external map navigation:

import QtQuick
import QtQuick.Controls

Button {
    width: 200
    height: width/5
    text: "Open in Maps"
    onClicked: {
        Qt.openUrlExternally(expression.evaluate("'geo:0,0?q=' || $y || ',' || $x"));
    }
}

The geo URI above is adapted to work with Android. For Apple Maps the URI can be changed to 'geo:' || $y || ',' || $x.