# Using @current\_parent\_feature in filename expression not working?

**URL:** <https://community.qfield.org/t/using-current-parent-feature-in-filename-expression-not-working/1379>\
**Category:** Ask the Community\
**Created:** [11 December 2025 10:43 UTC](https://community.qfield.org/t/using-current-parent-feature-in-filename-expression-not-working/1379 "2025-12-11T10:43:41Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![9ls1](https://dub1.discourse-cdn.com/flex018/user_avatar/community.qfield.org/9ls1/32/900_2.png) [@9ls1](https://community.qfield.org/u/9ls1)\
**Post date:** [11 December 2025 10:43 UTC](https://community.qfield.org/t/using-current-parent-feature-in-filename-expression-not-working/1379/1 "2025-12-11T10:43:41Z")

</div>

Has anyone succeeded in using a file naming expression including a field value from a parent layer -attribute(@current\_parent\_feature,‘’)- in a child layer? The child layer has an attachment widget for taking photos and I try to include the expression in layer properties – I can’t get it work neither in ver. 3.7.9 nor in beta version of 4.0.

 ![image](https://europe1.discourse-cdn.com/flex018/uploads/qfield/original/1X/dcc2681c7ff093ca0feba05e192e47e53097b748.png)

For more information, see [6862](https://github.com/opengisch/QField/issues/6862).

---

<div class="post-metadata">

**Author:** ![FelixHinckel](https://dub1.discourse-cdn.com/flex018/user_avatar/community.qfield.org/felixhinckel/32/704_2.png) [@FelixHinckel](https://community.qfield.org/u/FelixHinckel)\
**Post date:** [11 December 2025 13:00 UTC](https://community.qfield.org/t/using-current-parent-feature-in-filename-expression-not-working/1379/2 "2025-12-11T13:00:02Z")

</div>

Hi @9ls1 ,

Usually i prefer the use of

attribute(get\_feature(‘Parent\_layer’, ‘Parent\_layer\_id’, “Reference\_to\_Parent\_Layer”), ‘Parent\_layer\_targeted\_attribute’)

As far as I’ve seen, it works better than @current\_parent\_feature

---

<div class="post-metadata">

**Author:** ![9ls1](https://dub1.discourse-cdn.com/flex018/user_avatar/community.qfield.org/9ls1/32/900_2.png) [@9ls1](https://community.qfield.org/u/9ls1)\
**Post date:** [12 December 2025 12:01 UTC](https://community.qfield.org/t/using-current-parent-feature-in-filename-expression-not-working/1379/3 "2025-12-12T12:01:21Z")

</div>

@FelixHinckel Thanks for your time and suggestion. However, I tried that approach first without any success. (Sorry for not mentioning that!) I have also used “attribute(get\_feature(‘Parent\_layer’,…” in other fields with success, but not in the filename expression. After seraching the internet, I found promising information regarding using @current\_parent\_layer in [5327](https://github.com/opengisch/QField/discussions/5327). But I can’t get it working, so now I’m looking for proof that it actually works and that I (hopefully?) just have (spelling) error in my expression.

---

<div class="post-metadata">

**Author:** ![FelixHinckel](https://dub1.discourse-cdn.com/flex018/user_avatar/community.qfield.org/felixhinckel/32/704_2.png) [@FelixHinckel](https://community.qfield.org/u/FelixHinckel)\
**Post date:** [12 December 2025 12:40 UTC](https://community.qfield.org/t/using-current-parent-feature-in-filename-expression-not-working/1379/4 "2025-12-12T12:40:25Z")

</div>

Have you tried calculating a field ‘Name’, and using it in the filename expression?

---

<div class="post-metadata">

**Author:** ![9ls1](https://dub1.discourse-cdn.com/flex018/user_avatar/community.qfield.org/9ls1/32/900_2.png) [@9ls1](https://community.qfield.org/u/9ls1)\
**Post date:** [12 December 2025 15:42 UTC](https://community.qfield.org/t/using-current-parent-feature-in-filename-expression-not-working/1379/5 "2025-12-12T15:42:32Z")

</div>

@FelixHinckel Not sure what you mean. In my case I use a field called ‘plotid’ which gets it value from the parent-laye. ‘Plotid’ gets the correct value on-the-fly, see the screendump in the link to the issue-page (#6862). Do you mean I should add another field, called ‘Name’, in the layer and calculate the Name-value to be equal the Plotid-value? And in stead of ‘Plotid’, use ‘Name’ in the expression shown in the screendump above? (Sorry for being slow on a Friday afternoon in my timezone.) By the way, I also tried to use `to_string` on the `attribute(@parent_...`-expression - without any success.

---

<div class="post-metadata">

**Author:** ![FelixHinckel](https://dub1.discourse-cdn.com/flex018/user_avatar/community.qfield.org/felixhinckel/32/704_2.png) [@FelixHinckel](https://community.qfield.org/u/FelixHinckel)\
**Post date:** [12 December 2025 18:38 UTC](https://community.qfield.org/t/using-current-parent-feature-in-filename-expression-not-working/1379/6 "2025-12-12T18:38:42Z")

</div>

**I replicated a dummy example of what I understood :**

 ![image](https://europe1.discourse-cdn.com/flex018/uploads/qfield/original/1X/421c8df73972df44d64f4d09f1e4c9b15f5ab8c8.png)

Both layers are linked by a relation through point\>uuid and picture\>reference.

In the point layer, I set an attribute with a value that I want to show in the name of the picture file. Here : ‘value’, coming from point\>attribute.

**First case :**

I use attribute(@current\_parent\_feature,‘attribute’) to access the value :

 ![image](https://europe1.discourse-cdn.com/flex018/uploads/qfield/original/1X/473f1651ee3fe9bc43f393a652512ec6b19cbe98.png)

Result :

❌ The string ‘value’ doesn’t get included in the file name. (The ‘JPEG’ outcome is actually a default because the one I set led to an error : we can see there isn’t event the ‘picture\_’)

 ![image](https://europe1.discourse-cdn.com/flex018/uploads/qfield/original/1X/08191b0c7d1f89d9155c6d7dc23ca9d8deb701fa.png)

**Second case :**

I use attribute(get\_feature(‘point’,‘uuid’,“reference”) to access the value :

 ![image](https://europe1.discourse-cdn.com/flex018/uploads/qfield/original/1X/771e718d3bd87662bf36eb9f6434c15f3ad1eae6.png)

Result :

✅ The string ‘value’ gets included in the file name.

 ![image](https://europe1.discourse-cdn.com/flex018/uploads/qfield/original/1X/a146b24a25a791a5e307c304bdec6eff968c90bf.png)

Does that match what you need, and is it replicable on your project?

---

<div class="post-metadata">

**Author:** ![9ls1](https://dub1.discourse-cdn.com/flex018/user_avatar/community.qfield.org/9ls1/32/900_2.png) [@9ls1](https://community.qfield.org/u/9ls1)\
**Post date:** [13 December 2025 12:46 UTC](https://community.qfield.org/t/using-current-parent-feature-in-filename-expression-not-working/1379/7 "2025-12-13T12:46:14Z")

</div>

@FelixHinckel Thank you so much! I really appreciate your help and effort. Nevertheless, I can’t get it work in my case. I have made a test-project and uploaded it in a Comment in issue [6862](https://github.com/opengisch/QField/issues/6862): Just in case you have the time/are curious. 🧐 Perhaps the challenge is that attribute plotid in ‘plott start’ is “taken from” another layer ‘jvpunkter’ – even though plotid is shown in layer ‘plott start’?

---

<div class="post-metadata">

**Author:** ![FelixHinckel](https://dub1.discourse-cdn.com/flex018/user_avatar/community.qfield.org/felixhinckel/32/704_2.png) [@FelixHinckel](https://community.qfield.org/u/FelixHinckel)\
**Post date:** [14 December 2025 10:15 UTC](https://community.qfield.org/t/using-current-parent-feature-in-filename-expression-not-working/1379/8 "2025-12-14T10:15:05Z")

</div>

Ok got it!

For functions that seek attributes in other layer features, these feature have to be validated beforehand. In your case : as long as you don’t validate your plott start point, the startbilder won’t be able to access its data.

Example from your project : I created a plott start, satisfied all the constraints, and saved it. When I want to modify it and add a picture, the functions you set work well :

 ![image](https://europe1.discourse-cdn.com/flex018/uploads/qfield/original/1X/a9b2ff172405b311b9265a53bd11d9bc1d849d4e.png)

 ![image](https://europe1.discourse-cdn.com/flex018/uploads/qfield/original/1X/2bf6448dac6b319209ba8de3e3ca4c09e4f90002.png)

One thing to make it easier : activate the fast editing mode :

 ![image](https://europe1.discourse-cdn.com/flex018/uploads/qfield/original/1X/8a94024c5fb07f61f36fec9410c6c62600f78f48.png)

With this configuration, as soon as your plott start satisfies the constraints, the feature is automatically validated and saved. Which allows you add pictures with correct naming. In other word, with this setting, as soon as the form turns green you can add pictures.

Hope that helps!

---

<div class="post-metadata">

**Author:** ![9ls1](https://dub1.discourse-cdn.com/flex018/user_avatar/community.qfield.org/9ls1/32/900_2.png) [@9ls1](https://community.qfield.org/u/9ls1)\
**Post date:** [14 December 2025 16:29 UTC](https://community.qfield.org/t/using-current-parent-feature-in-filename-expression-not-working/1379/9 "2025-12-14T16:29:24Z")

</div>

@FelixHinckel Juhu, it works! 🎉Thank you! Fast editing mode was activated, but I had not fully understood the concept that all constraints had to be satisfied _before_ I captured the photo. I just entered data from top to bottom in the form. Thank you for enlightening me.👍
