MerginMaps / MerginMaps/mobile
Default value referencing another field from the same form not applied when adding a new feature
Nobody has claimed this yet.
- 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
- In QGIS, open an existing Mergin Maps project or create a new one via the Mergin Maps plugin
- Create a new GeoPackage file with at least 3 fields,
project(text),date(date/time), andname(text). Set default value expressions:project→@mm_project_name,date→now() - In the field properties for
name, set the default value expression to"project" || ' ' || "date"and enable Apply default value on update - Sync the project to Mergin Maps
- Open the project in the Mergin Maps mobile app
- Start adding a new feature — verify that the
namefield is correctly populated with the default value (no manual input needed, all values are filled by default expressions) — then cancel without saving - Start adding another new feature at the same location (without moving the map canvas)
Actual results
- The
namefield remains NULL after saving the new feature - The
namefield 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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