Skip to content

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

@RastoHu

Description

@RastoHu

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

ScreenRecording_03-24-2026.13-03-57_1.MP4

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugformsrelated to attribute forms

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions