Possible to change exported default project filename?

Copying QGIS-projects to tablet/QField through QField Sync/USB-cable.
It seems like all projects names get the suffix _qfield added to their QGIS project filename, e.g apelsvoll.qgs ends up as apelsvoll**_qfield**.qgs in the export-folder.

This causes an error in my expression: aggregate(layer:=project_basename||'_skifte_f', aggregate:='max', expression:="skiftenr"||coalesce("del",null), filter:=intersects($geometry, geometry(parent)))

I have set polygon layer B within polygon layer A to inherit an attribute value set in polygon layer A. The polygon layer name starts withe the project’s base name. This works as a charm in QGIS without any hassle. I make it working in QField as well, but in that case I have to change the project name from apelsvoll_qfield.qgs to apelsvoll.qgs before copying the folder onto the tablet.

apelsvoll_forsok_f inherits the skiftenr-value 23a from apelsvoll_skifte_f in a QGIS-project called apelsvoll.

So, is there a way to change the default project filename when exporting? So far I haven’t find any way through the settings nor the preferences in QField Sync.

Using QGIS 3.26.3 and QField Sync 4.2.0.


Imported from GitHub discussion by @9ls1 on 2022-10-05T14:47:10Z

It is not possible to change the _qfield prefix in QFieldSync. It exists for a good reason so people don’t confuse which is the original or the exported project.

However, I think you can safely do it like this for your project:

aggregate(layer:=replace(project_basename, '_qfield', '')||'_skifte_f', aggregate:='max', expression:="skiftenr"||coalesce("del",null), filter:=intersects($geometry, geometry(parent)))

Imported from GitHub comment by @suricactus on 2022-10-08T21:14:45Z

suricactus Ah, I never thought of the replace-possibility, thanks! Now it works like a charm in both QGIS and QField.


Imported from GitHub comment by @9ls1 on 2022-10-09T10:15:07Z