Transfer attributes from parent to child feature using `@current_parent_feature`

I’m trying to transfer values from a parent feature to a child by using attribute(current_parent_feature,'Site') as the default expression and then use the values for photo filenames.

I am trying to use current_parent_feature over other solutions like attribute(get_attribute( ) ) as the layer name/id and relationship name/ids will change.

Currently the values from the parent are retrieved and displayed in child form correctly, but aren’t saved or accessible unless edited (i.e. add a space/hyphen). As a result they aren’t accessible by the photo naming expression either.

Is it possible to use current_parent_feature in this way with Qfield?

The following shows the behavior I am experiencing.

I have also included a simplified QGIS project & packaged QField project to demonstrate.

I am using QGIS 3.36.2-Maidenhead for Windows, QField Sync 4.9.1 and Qfield 3.2.2-Congo on Android 14 (Samsung Active 4 Pro).


Imported from GitHub discussion by @cratcliff on 2024-06-11T03:51:49Z

Thank you for reporting this, cratcliff

We have made a couple of improvements in this area, could you check if this is still an issue with QField 3.3?


Imported from GitHub comment by @m-kuhn on 2024-06-16T04:28:22Z

m-kuhn Yes, it is still an issue. I’m now using Qfield 3.3.1-Darien(6b9cd v3.3.1) and QGIS 3.36.3-Maidenhead.


Imported from GitHub comment by @cratcliff on 2024-06-17T00:12:04Z

m-kuhn I’ve just upgraded again to 3.3.2 Darien (a2b463 v3.3.2) and it is still an issue.


Imported from GitHub comment by @cratcliff on 2024-06-19T02:11:57Z

cratcliff , thanks for providing a test project. A fix to the issue raised in this discussion has been found. You can test the APKs that will appear here to confirm it works as expected: Fix @current_parent_* default value not saved on child creation by nirvn · Pull Request #5356 · opengisch/QField · GitHub


Imported from GitHub comment by @nirvn on 2024-06-19T08:36:56Z