Skip to content

Commit 95ce435

Browse files
authored
Iss 680 add warning about characters that are not allowed in photo names (#683)
* add warning about characters that are not allowed in photo names * fix broken link * review+typo
1 parent 737d1fc commit 95ce435

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/gis/photo-names/index.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ Names of the photos that are captured in the field using <MobileAppName /> can b
66

77
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.
88

9-
To set up custom photo names:
9+
## Set up custom photo names
10+
1011
1. Open your <MainPlatformNameLink /> project in QGIS and navigate to **Project Properties**
1112
![QGIS Project Properties](../qgis-project-properties.jpg "QGIS Project Properties")
1213

@@ -17,13 +18,17 @@ To set up custom photo names:
1718

1819
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.
1920

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)):
2122
` @layer_name + '-' + @mm_username + '-' + format_date(now(),'yyMMddhhmmss')`
2223

2324
Example result is displayed in the **Preview**: `hedges-sarah-230707194052`
2425

2526
![QGIS Expression for custom photo name](./plugin-photo-name-expression-builder.jpg "QGIS Expression for custom photo name")
2627

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+
2732
Click **OK** to confirm the expression.
2833

2934
4. Set up the photo name format for other fields and layers.
@@ -33,22 +38,24 @@ To set up custom photo names:
3338
![Mergin Maps QGIS Plugin photo name setup with custom folder](./plugin-photo-name-format-folder.jpg "Mergin Maps QGIS Plugin photo name setup with custom folder")
3439
![Mergin Maps QGIS Plugin Custom photo name setup without custom folder](./plugin-photo-name-format.jpg "Mergin Maps QGIS Plugin Custom photo name setup without custom folder")
3540

36-
### Best practice for photo name expressions
41+
## Best practice for photo name expressions
3742
There are some tips to keep in mind when creating the expression for your photo name:
3843

3944
: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.
4045

4146
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.
4247

48+
:no_entry_sign: Avoid using special characters such as `|?*"<>` in the photo name.
49+
4350
:white_check_mark: The file extension (`.jpg`) is added automatically.
4451

4552
: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!
4653

4754
: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
4855

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.
5057

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.
5259

5360
In general, it is useful to use some of these variables:
5461
- 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:
6471
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.
6572

6673

67-
### Examples of photo names expressions
74+
## Examples of photo names expressions
6875
Here are some example expressions that can be used or modified to fit your needs:
6976

7077
- Expression: ` @layer_name + '-' + @mm_username + '-' + format_date(now(),'yyMMddhhmmss')`

0 commit comments

Comments
 (0)