The original version of this document is located at https://docs.qfield.org/how-to/advanced-how-tos/variables
QField allows users to add and edit expression variables.
These can be used for a wide range of applications, including data-defined symbology, setting default field values, controlling print layout and application behavior, and much more.
See the relevant QGIS documentation for more information.
QField supports two main types of custom variables:
Project variables are defined and managed directly within the QGIS project on your desktop.
They allow you to add custom variables that are only relevant in the context of a specific project.
QField users can edit those variables, with modified values remembered across sessions.
QField comes pre-configured with some read-only global variables which are visible in under side Dashboard > Settings > Variables.
New variables can be added or modified and will be available in QField across sessions.
Information
The read-only variables differ from device to device.
These reflect the global variables from the specific QGIS version that was being used to develop the installed version of QField.
Variables are managed directly on your device and are accessible in all available QField projects.
When you access the variables list in QField ( Side Dasboard > Settings > Variables ), you will find a consolidated and organized view of all available variables.
📱 Fieldwork
To configure a application-specific variable, follow these steps:
Here you will see a list of all variables currently applicable to your project.
To add a new variable:
Common variables to use are:
Note
If you are not using QFieldCloud you can add a unique identifier instead.
Since the application-wide variables are not bound to specific projects and are defined locally, they are a great way to optimize the fieldwork experience for multiple users sharing the same projects.
