<p>For a field outside the Matrix, you can use <code>{username}</code> and for the one in the Matrix, use <code>{owner.username}</code> - <a href="https://docs.craftcms.com/v3/assets-fields.html#dynamic-subfolder-paths" rel="nofollow noreferrer">see docs</a></p>

<p>You might need to run Utilities → Asset Indexes.</p>

CC BY-SA 4.0
2020-06-09T10:07:26.117Z
2020-06-09T10:07:26.117Z
Oli
<p>I have an asset volume which uses dynamic subfolders on the field level. </p>

<p>I have an assets volume called 'members'.
In a matrix field on the user profile tab there is an image field that sets its upload directory to be <code>{owner.author.username}</code> within the members volume.
In my filesystem there is a folder called <code>web/images/members/username</code> (where username is the actual username). This folder contains images.</p>

<p>FYI this Craft site is 5 years old and has recently gone through a major upgrade to Craft v3.</p>

<p>I cannot get the assets field to show existing images when trying to edit it in the admin panel.</p>

<p>I have tried various permutations in the dynamic subfolder path, for example:</p>

<ul>
<li><code>{owner.username}</code></li>
<li><code>{currentUser.username}</code></li>
<li><code>{{currentUser.username}}</code></li>
</ul>

<p>But in no situation can I get the field to see the images in the subfolder.</p>

<p>There are fields in matrixes and also basic asset fields not in matrixes that have this issue, so I need assistance in how to set up the matrix asset fields and non-matrix asset fields to be able to see the same folder.</p>

<p>Many thanks</p>

<assets><matrix><user-profile><assets-field><volumes>
Asset volumes with dynamic subfolder
# Asset volumes with dynamic subfolder

(Asked by: username_0 on 2020-06-09)

I have an asset volume which uses dynamic subfolders on the field level.

I have an assets volume called 'members'.
In a matrix field on the user profile tab there is an image field that sets its upload directory to be `{owner.author.username}` within the members volume.
In my filesystem there is a folder called `web/images/members/username` (where username is the actual username). This folder contains images.

FYI this Craft site is 5 years old and has recently gone through a major upgrade to Craft v3.

I cannot get the assets field to show existing images when trying to edit it in the admin panel.

I have tried various permutations in the dynamic subfolder path, for example:

* `{owner.username}`
* `{currentUser.username}`
* `{{currentUser.username}}`

But in no situation can I get the field to see the images in the subfolder.

There are fields in matrixes and also basic asset fields not in matrixes that have this issue, so I need assistance in how to set up the matrix asset fields and non-matrix asset fields to be able to see the same folder.

Many thanks

**Tags:** assets, matrix, user-profile, assets-field, volumes


---

## 1 answers

### Answer by username_1 on 2020-06-09. Score: 1

For a field outside the Matrix, you can use `{username}` and for the one in the Matrix, use `{owner.username}` - [see docs](https://docs.craftcms.com/v3/assets-fields.html#dynamic-subfolder-paths)

You might need to run Utilities → Asset Indexes.


---

