Skip to content

Commit 9e857d0

Browse files
authored
Merge pull request #594 from opengisch:m-kuhn-patch-1
Improve variable documentation
2 parents db2848a + 0c27572 commit 9e857d0

File tree

1 file changed

+27
-11
lines changed

1 file changed

+27
-11
lines changed

documentation/how-to/variables.en.md

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,41 @@ tx_slug: documentation_how-to_variables
55

66
# Variables
77

8-
QField allows user to add and edit expression variables.
8+
QField allows users to add and edit expression variables.
99
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.
10-
See [the relevant QGIS documentation](https://docs.qgis.org/3.40/en/docs/user_manual/introduction/general_tools.html#storing-values-in-variables) for more information.
10+
See [the relevant QGIS documentation](https://docs.qgis.org/latest/en/docs/user_manual/introduction/general_tools.html#storing-values-in-variables) for more information.
1111

12-
QField supports two main types of variables:
12+
QField supports two main types of custom variables:
1313

1414
- **Project Variables:** Project-bound variables defined within the project file.
15-
- **Global Variables:** Application-wide global variables with a set of read-only variables matching those found in QGIS.
15+
- **Global Variables:** Application-wide global variables with a set of read-only variables.
16+
17+
1618

1719
## Project Variables
1820

19-
Project variables are defined and managed directly within your QGIS project.
21+
Project variables are defined and managed directly within the QGIS project on your desktop.
2022
They allow you to add custom variables that are only relevant in the context of a specific project.
2123
QField users can edit those variables, with modified values remembered across sessions.
2224

2325
## Global Variables
2426

25-
New global variables can be added or modified once and will be injected into all projects opened in QField across sessions.
26-
Global variables can be used to add a unique identifier across a fleet of QField devices for example, or determine the language for a given QField user.
27-
Since they are not bound to specific projects and are defined locally, they make for a great way to customize experience for multiple users sharing the same projects.
27+
QField comes pre-configured with some read-only global variables which are visible in *Settings > Variables*.
28+
New variables can be added or modified and will be available in QField across sessions.
29+
30+
!!! Information
31+
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.
2832

2933
## Variable Management in QField
3034

3135
Variables are managed directly on your device and are accessible in all available QField projects.
32-
When you access the variables list in QField ( Settings > Variables ), you will find a consolidated and organized view of all available variables.
36+
When you access the variables list in QField ( *Settings > Variables* ), you will find a consolidated and organized view of all available variables.
3337

3438
### Variable configuration
3539

3640
:material-tablet: Fieldwork
3741

38-
To configure a device-specific variable, follow these steps:
42+
To configure a application-specific variable, follow these steps:
3943

4044
1. Open **Settings** in QField.
4145
2. Navigate to the **Variables** tab.
@@ -44,7 +48,19 @@ Here you will see a list of all variables currently applicable to your project.
4448
To add a new variable:
4549

4650
1. Click on *Add a new variable* at the bottom of the variable list.
47-
2. Enter the name and value for your new variable.
51+
2. Enter the name and value for your new variable and save.
52+
53+
### Useful Examples
54+
55+
Common variables to use are:
56+
57+
- **@cloud_username** to incorporate the details of the individual users in a project.
58+
59+
**Note**: If you are not using QFieldCloud you can add a unique identifier instead.
60+
61+
- **@qgis_locale** to use the currently set language of QGIS/QField.
62+
63+
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.
4864

4965
!![Configuration of editable variables in addition to the
5066
pre-defined system variables.](../assets/images/configure_global_variables.png, 400px)

0 commit comments

Comments
 (0)