# Update attachement filename

**URL:** <https://community.qfield.org/t/update-attachement-filename/1963>\
**Category:** Ask the Community\
**Created:** [29 September 2026 07:22 UTC](https://community.qfield.org/t/update-attachement-filename/1963 "2026-09-29T07:22:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jp136769](https://dub1.discourse-cdn.com/flex018/user_avatar/community.qfield.org/jp136769/32/1551_2.png) [@jp136769](https://community.qfield.org/u/jp136769)\
**Post date:** [29 September 2026 07:22 UTC](https://community.qfield.org/t/update-attachement-filename/1963/1 "2026-09-29T07:22:20Z")

</div>

Hi all,

I’ve configured [personalised path](https://docs.qfield.org/how-to/project-setup/pictures/#configurable-attachment-path) and filename like this for my attachments :

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

If the field “Nom” changes, the name does not seem to update. How to?

Or should I use uuid instead?

---

<div class="post-metadata">

**Author:** ![cuprico](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@cuprico](https://community.qfield.org/u/cuprico)\
**Post date:** [29 September 2026 16:15 UTC](https://community.qfield.org/t/update-attachement-filename/1963/2 "2026-09-29T16:15:51Z")

</div>

I think you’ll be better up using some unchangeable value like an uuid, or even the `fid`your layer most likely already has; something unique just to relate the photos with the feature. Otherwise, there seems to be no trivial way to resolve what happens when you change the other attribute, for example:

- previous photos should be moved to the new path?
- what if the photo is missing or just temporarily unavailable (on a remote drive for example)?
- what happens if there already is a file with that name?

I think qgis in general pretty much avoids handling the attachments for you. For example, if you delete a feature on QField, or even if you take a new picture, the old picture stays on the drive. So think of the attachments as something you have to handle “manually” on your end. Giving the path an unchanging and predictable name is an easy way to handle them, although it does not look pretty.

Tangentially, I see that you are storing more than one picture. If this is only to give the user the possibility of taking multiple photos per feature and there is no specific meaning for `photo1` and `photo2`, maybe you can create an additional table that holds multiple pictures per feature. QField will then show you all the related pictures in a gallery when you open the feature form, and you can dynamically add as many as you want (it can even be a picture plus an optional description or any number of additional attributes per picture). Check [this video tutorial](https://www.youtube.com/watch?v=Kec-PsiZt6k) to see an example of how this can be done.

---

<div class="post-metadata">

**Author:** ![VxTedxV](https://dub1.discourse-cdn.com/flex018/user_avatar/community.qfield.org/vxtedxv/32/1244_2.png) [@VxTedxV](https://community.qfield.org/u/VxTedxV)\
**Post date:** [29 September 2026 23:30 UTC](https://community.qfield.org/t/update-attachement-filename/1963/3 "2026-09-29T23:30:46Z")

</div>

1. Try to use `concat()` instead of `||`.  
I succeed with more complex expressions with that.
2. Another subtle tweak to try : if not already in your form, add “Nom” field in it, hide it if not needed and call it with `current_value("Nom")` : instead of taking the value from the table, it takes the value from the form…

---

<div class="post-metadata">

**Author:** ![jp136769](https://dub1.discourse-cdn.com/flex018/user_avatar/community.qfield.org/jp136769/32/1551_2.png) [@jp136769](https://community.qfield.org/u/jp136769)\
**Post date:** [30 September 2026 09:25 UTC](https://community.qfield.org/t/update-attachement-filename/1963/4 "2026-09-30T09:25:08Z")

</div>

Hi all,

@cuprico thanks for the explanation, I’ll stick with my two fields for this specific project but it’s good to know!  
@VxTedxV I’ve changed from `||` to `concat()` plus `current_value("Nom")` and got no return from `current_value("Nom")` in the picture filename (all the rest of the filename is correctly concatenated.

I’ve finally opted for `uuid('WithoutBraces')` in the attachments settings.
