You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/gis/photo-names/index.md
+13-6Lines changed: 13 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,8 @@ Names of the photos that are captured in the field using <MobileAppName /> can b
6
6
7
7
To use this option, make sure that the [photo widget](../../layer/photos/) of the fields you use for taking pictures is set up correctly, i.e. using the attachment widget, storing relative paths and, if needed, with a [custom folder](../../layer/photos/#how-to-set-up-a-custom-folder-for-storing-photos) for storing photos.
8
8
9
-
To set up custom photo names:
9
+
## Set up custom photo names
10
+
10
11
1. Open your <MainPlatformNameLink /> project in QGIS and navigate to **Project Properties**
3. In the **Expression Dialog** window, enter the expression that should be used as the photo's name. Please, keep in mind [basic recommendations](#best-practice-for-photo-name-expressions) to make sure the naming works as intended.
19
20
20
-
Here we use a combination of the layer's name, <MainPlatformName /> username and current timestamp (other examples ale listed [below](#examples-of-photo-names-expressions)):
21
+
Here we use a combination of the layer's name, <MainPlatformName /> username and current timestamp (other examples are listed [below](#examples-of-photo-names-expressions)):
Example result is displayed in the **Preview**: `hedges-sarah-230707194052`
24
25
25
26

26
27
28
+
:::warning Do not use special characters in photo names
29
+
Special characters in photo names can cause synchronisation issues. Therefore, it is not allowed to use characters such as `|?*"<>`.
30
+
:::
31
+
27
32
Click **OK** to confirm the expression.
28
33
29
34
4. Set up the photo name format for other fields and layers.
@@ -33,22 +38,24 @@ To set up custom photo names:
33
38

34
39

35
40
36
-
###Best practice for photo name expressions
41
+
## Best practice for photo name expressions
37
42
There are some tips to keep in mind when creating the expression for your photo name:
38
43
39
44
:white_check_mark:**Each photo needs to have a unique name** to avoid issues during synchronisation and ensure that photos and features are linked correctly.
40
45
41
46
Therefore, we recommend using combinations of variables that will ensure that there would not be multiple photos with the same name, such as the current date and time `now()`, <MainPlatformName /> username `@mm_username`, layer name `@layer_name` or a field value.
42
47
48
+
:no_entry_sign: Avoid using special characters such as `|?*"<>` in the photo name.
49
+
43
50
:white_check_mark: The file extension (`.jpg`) is added automatically.
44
51
45
52
:white_check_mark: When using a field value in the expression, make sure that it is a field that will be filled out during the survey, e.g. by using [constraints](../../layer/form-configuration/#constraints). If the field is empty, the expression won't work!
46
53
47
54
:white_check_mark: If you want to use a [numeric field](../../layer/form-widgets/#numbers) or other non-text fields in your expression, you need to convert it to a string first using the `to_string()` function
48
55
49
-
:no_entry_sign: The expression is evaluated with the **current** field values. The name of the photo will stay the same even if you change the value of the field later.
56
+
:warning: The expression is evaluated with the **current** field values. The name of the photo will stay the same even if you change the value of the field later.
50
57
51
-
:no_entry_sign: The setup needs to be saved and synchronised. Only photos that are taken after synchronisation will have the name defined by the expressions. Existing photos will keep their original names.
58
+
:warning: The setup needs to be saved and synchronised. Only photos that are taken after synchronisation will have the name defined by the expressions. Existing photos will keep their original names.
52
59
53
60
In general, it is useful to use some of these variables:
54
61
- Current timestamp `now()` is a good starting point to ensure uniqueness of the name of the photo.
@@ -64,7 +71,7 @@ In general, it is useful to use some of these variables:
64
71
Depending on the layers in your project and their fields, it can help create a unique photo name when taking multiple pictures in a row. It can also help to make it easier to browse pictures in your <MainPlatformNameLink /> project.
65
72
66
73
67
-
###Examples of photo names expressions
74
+
## Examples of photo names expressions
68
75
Here are some example expressions that can be used or modified to fit your needs:
0 commit comments