Skip to content

App unable to create subfolders based on expression values #4370

@raherin

Description

@raherin

Summary

The app returns 'Failed to process image' error when saving a photo where the Attachment widget has been set to use default location expression that includes a sub-folder based on the value of another field.

To reproduce

  • Create a project with a survey layer that has one text field for storing a photo (photos) and one other text or int field (status)

  • Set the status field as a value map type widget and create some pre-set values for the user to select, make sure the values do not contain any spaces or characters prohibited for file paths

    • enable and enforce the Not null constraint for this field
    • make sure that 'Apply default on update' is disabled
  • Use an Attachment widget for the photos field and set the Default path to @project_folder + '/Photos/' + "stage"

  • Make sure to set Store path as to Relative to project path

  • Save and upload the project

When you download the project in the mobile app, create a new feature, select a value for the status field and then try to attach a photo from the camera or gallery, the app will return a 'Failed to process image' error.

Another observation is that setting a default value for the status field will result in a photo being saved to a subfolder named after the default value, no matter which value is selected for the field.

I have attached a basic project with the settings described above.

Device info

QGIS version used to create project: 3.40.8
Mergin Maps plugin used to create project: 2026.2.1
Mobile device: Samsung A53
Mobile OS: Android 16
Mergin Maps app: 2026.1.0

sub_photo.zip

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions