QField icon indicating copy to clipboard operation
QField copied to clipboard

Multi-editing of attributes does not update @cloud_username

Open Jeroen-GroeneBij opened this issue 1 month ago • 6 comments

What is the bug or the crash? What were your expectations and what actually happened?

When editing attributes having multiple features selected, any field with a Default value @cloud_username in the Attributes Form (Apply on update) is not updated. Using other global variables, such as @qgis_locale, do get updated.

Steps to reproduce the issue

In a layer with multiple features make sure at least one field is set to have a Default value @cloud_username and tick the checkbox Apply default value on update. For comparison, also have a field set to have a Default value @qgis_locale and tick the checkbox Apply default value on update.

In QField, select multiple features and edit a field not being the ones with the Default value. The result is the field with @cloud_username will be NULL and the field wit @qgis_locale will be filled.

Version

3.7.9

Operating system name

Android

Operating system version

16

Reinstall QField

  • [ ] I have a fresh install of the latest QField version, but the problem persists.
  • [ ] Problem can be reliably reproduced, doesn't happen randomly.
  • [ ] Problem happens with all files and projects, not only some files or projects.

Additional context

No response

Jeroen-GroeneBij avatar Dec 12 '25 11:12 Jeroen-GroeneBij

@Jeroen-GroeneBij , can you share a small sample project?

nirvn avatar Dec 12 '25 12:12 nirvn

Good question, how do I share a QField project? Or more precise, how do I share a QField Cloud project without sharing credentials.

Jeroen-GroeneBij avatar Dec 12 '25 13:12 Jeroen-GroeneBij

Here is at least a QGIS project, without QField settings, but with the Attributes Form settings.

bugtest_qfield.zip

Jeroen-GroeneBij avatar Dec 12 '25 13:12 Jeroen-GroeneBij

I also just noticed the field with @cloud_username is not updated on duplicating an object. So maybe even more actions do not trigger correctly.

Jeroen-GroeneBij avatar Dec 12 '25 14:12 Jeroen-GroeneBij

@Jeroen-GroeneBij , I can't see how QField behaves differently from QGIS. For e.g., if I add a @cloud_username project variable in QGIS (to get a variable to check against), multi-editing features in QGIS will not change the value to @cloud_username

nirvn avatar Dec 14 '25 09:12 nirvn

Hmm,

I did some testing to see if there is different behaviour in QGIS between a custom global, project or layer variable. However, I can not replicate your result @nirvn If I add a variable cloud_username either as global variable, or as project variable, or as layer variable, in all cases it gets used and updates the specific field, also in multi-editing.

I am using QGIS 3.40.12 for this, on Windows10

Jeroen-GroeneBij avatar Dec 14 '25 17:12 Jeroen-GroeneBij

@Jeroen-GroeneBij , can you make a screencast of multi-editing of features changing the field value to a project variable?

nirvn avatar Dec 15 '25 01:12 nirvn

(Or alternatively, provide clear step-by-step instructions that lead to 2 distinct features with different field values being updated to a project variable when multi-editing)

nirvn avatar Dec 15 '25 01:12 nirvn

The new attached zip has a geopackage including the project.

test_layers.zip

In QGIS

  • check if the project has a variable called cloud_username with the value a_good_name
  • check the attributes form for simple_layer: both fields user and locale should have a Default value set and the checkbox Apply default on update is ticked.

Step 1 open attribute table, toggle editing mode, toggle mutli edit mode Step 2 select two features, change the value of name to something else

Image

Step 3 Click apply changes and both fields user and locale are updated

Image

Jeroen-GroeneBij avatar Dec 15 '25 08:12 Jeroen-GroeneBij