Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/field/tracking/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Enabled tracking means that a new line layer for tracking will be created in you
| `tracking_start_time` | DateTime | `@tracking_start_time` | Date and time when tracking started |
| `tracking_end_time` | DateTime | `@tracking_end_time` | Date and time when tracking ended |
| `total_distance` | Real | `$length` | Tracked distance |
| `tracked_by` | String | `@mergin_username` | Name of the current <MainPlatformNameLink /> user |
| `tracked_by` | String | `@mm_username` | Name of the current <MainPlatformNameLink /> user |

You can add new fields as needed, however, they should be set up with automatically generated [default values](../../layer/form-configuration/#default-values) as <MobileAppName /> will not open the form for manual inputs. You may use some of the QGIS functions, [extra position variables](../../layer/position_variables/) or [extra QGIS variables](../../layer/plugin-variables/).

Expand Down
8 changes: 4 additions & 4 deletions src/gis/photo-names/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ To set up custom photo names:
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.

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

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

Expand All @@ -38,7 +38,7 @@ There are some tips to keep in mind when creating the expression for your photo

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

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 `@mergin_username`, layer name `@layer_name` or a field value.
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.

:white_check_mark: The file extension (`.jpg`) is added automatically.

Expand All @@ -55,7 +55,7 @@ In general, it is useful to use some of these variables:

It can be variously reformatted using the `format_date()` function. See <QGISHelp ver="latest" link="/user_manual/expressions/functions_list.html#format-date" text="See QGIS User manual" /> for more details.

- When working in a team, consider using <MainPlatformName /> username `@mergin_username`.
- When working in a team, consider using <MainPlatformName /> username `@mm_username`.

Even if multiple team members capture a photo at the same time, the name will be different. Also, it makes it easy to sort photos based on who took them.

Expand All @@ -67,7 +67,7 @@ In general, it is useful to use some of these variables:
### Examples of photo names expressions
Here are some example expressions that can be used or modified to fit your needs:

- Expression: ` @layer_name + '-' + @mergin_username + '-' + format_date(now(),'yyMMddhhmmss')`
- Expression: ` @layer_name + '-' + @mm_username + '-' + format_date(now(),'yyMMddhhmmss')`
- Preview: `hedges-sarah-230707154052.jpg`
- Description: This is a combination of the name of a layer (`hedges`), <MainPlatformName /> username (`sarah`) and reformatted timestamp that starts with the year and ends with seconds.

Expand Down
10 changes: 5 additions & 5 deletions src/layer/form-configuration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ Various usage of default values can be explored in more detail by downloading or
Let's set up an attributes to record the <MainPlatformName /> username of the surveyor who *created* a feature:
1. Right-click on a layer, select **Properties** and go to the **Attributes form** tab.
2. In the list of **Available Widgets** select the text field you want to use (here: `inserted_by`)
3. In the **Defaults** tab, define the **Default value** as `@mergin_username`.
3. In the **Defaults** tab, define the **Default value** as `@mm_username`.
Do not check the **Apply default value on update** option :white_large_square:.

![QGIS attributes form Mergin Maps username default value](./qgis-form-default-inserted-by.jpg "QGIS attributes form Mergin Maps username default value")

To save the <MainPlatformName /> username of the surveyor who *modified* this feature, the steps are similar:
1. In the list of **Available Widgets** select the text field you want to use (here: `updated_by`)
2. In the **Defaults** tab, define the **Default value** as `@mergin_username`.
2. In the **Defaults** tab, define the **Default value** as `@mm_username`.
Check the **Apply default value on update** option :heavy_check_mark:. The field will be updated anytime the feature is modified, saving the name of the surveyor who made the changes.

![QGIS attributes form Mergin Maps username default value](./qgis-form-default-updated-by.jpg "QGIS attributes form Mergin Maps username default value")
Expand Down Expand Up @@ -81,7 +81,7 @@ There are some commonly used default values that can be useful in your field sur

- It is convenient to know when a feature was created and when it was last updated. Use fields with **Date** or **Date&Time** data types with the `now()` function to record this information. You can change the formatting using the [Date/Time](../form-widgets/#date-and-time) widget.

- The name of the <MainPlatformName /> user who created or modified the feature can be recorded using the `@mergin_username` variable. These fields should use **Text (string)** data type.
- The name of the <MainPlatformName /> user who created or modified the feature can be recorded using the `@mm_username` variable. These fields should use **Text (string)** data type.
There are also other [extra QGIS variables](../position_variables/) related to your <MainPlatformName /> account or service that can be used as default values.

- The coordinates of a point feature can be recorded as well using the `$x` and `$y` function in QGIS. To record the coordinate accurately, these fields should have the **Decimal number (real)** data type. If the coordinates are in metres, values can be rounded to, say, 2-3 decimal places. When working with geographic coordinates that use degrees, you may want to round the coordinates to 8 decimal places. Use the *apply default value on update* option so that you have correct values when the position of the point feature changes.
Expand All @@ -96,8 +96,8 @@ Here are some examples:
|-----------------------------|-------------------------------|---------|-------------|
| `@now` | `2024-06-30 10:00:00` | **no** | The timestamp of when the feature was created. |
| `@now` | `2024-06-30 10:30:00` | **yes** | The timestamp of when the feature was last **updated**. |
| `@mergin_username` | `sarah` | **no** | Name of the user who created this feature.|
| `@mergin_username` | `jack` | **yes** | Name of the user who **updated** this feature last.|
| `@mm_username` | `sarah` | **no** | Name of the user who created this feature.|
| `@mm_username` | `jack` | **yes** | Name of the user who **updated** this feature last.|
| `round($x,2)` | `1898789.92` | **yes** | The X coordinate of a point feature, rounded to 2 decimal places.|
| `$length` | `123.45` | **yes** | The length of a line feature.|
| `$area` | `1234.56` | **yes** | The area of a polygon feature.|
Expand Down
Loading