MerginMaps / MerginMaps/mobile

Default value referencing another field from the same form not applied when adding a new feature

Open
#4,417 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug forms
Dominant language
C++
Stars
388
Forks
87
Avg merge
2d 7h
Merged PRs (30d)
20

Description

Description

When a form field has a default value expression that references another field from the same form (e.g. "project" || ' ' || "date"), the default value is not applied when adding a new feature under specific conditions. The default value is correctly applied when editing/updating an existing feature.

Environment
[x] Staging [ ] PROD

Application (+ app version, build, operating system)

  • Mergin Maps mobile 2026.1.2
  • iOS 26.0

Steps to reproduce

  1. In QGIS, open an existing Mergin Maps project or create a new one via the Mergin Maps plugin
  2. Create a new GeoPackage file with at least 3 fields, project (text), date (date/time), and name (text). Set default value expressions: project@mm_project_name, datenow()
  3. In the field properties for name, set the default value expression to "project" || ' ' || "date" and enable Apply default value on update
  4. Sync the project to Mergin Maps
  5. Open the project in the Mergin Maps mobile app
  6. Start adding a new feature — verify that the name field is correctly populated with the default value (no manual input needed, all values are filled by default expressions) — then cancel without saving
  7. Start adding another new feature at the same location (without moving the map canvas)

Actual results

  • The name field remains NULL after saving the new feature
  • The name field is correctly populated after subsequently editing/updating the same feature

Expected results

The name field should be populated with the concatenated value of project and date (e.g. MyProject 2024-03-24) already when adding the new feature.

Screenshots or logs

https://github.com/user-attachments/assets/971761a4-e4ef-408d-acae-2c83c4e282ba

Conclusion
Created by Claude and supervised by a human test analyst.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two consecutive add-feature flows in Mergin Maps mobile 2026.1.2 using the described GeoPackage fields and default expressions. Compare the form state after cancelling the first feature with the second feature at the same location, then verify that the name value is populated before saving and remains correct after saving.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, ios
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.