# Dynamic Image names in callback

**URL:** https://community.plotly.com/t/dynamic-image-names-in-callback/66428
**Category:** Dash Python
**Created:** [July 25, 2022, 6:30pm UTC](https://community.plotly.com/t/dynamic-image-names-in-callback/66428 "2022-07-25T18:30:25Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![DrSmith69](https://avatars.discourse-cdn.com/v4/letter/d/ed655f/32.png) [@DrSmith69](https://community.plotly.com/u/DrSmith69)
#### Post date: [July 25, 2022, 6:30pm UTC](https://community.plotly.com/t/dynamic-image-names-in-callback/66428/1 "2022-07-25T18:30:25Z")

</div>

Hi All,

Just a question, how would I go about including dynamic image names in Dash Callbacks - I am in the process of migrating my images from external source to internal into the dash assets folder, subfolder PLImages

Currently, my dash snippet looks like this:

```auto
def p1_select(p_name):
    if p_name is not None:
        dff = df[df.P == p_name]
        return dff['ImageLink'].unique(), \

```

Now I want to use the internal call with the image name being p\_name.png - meaning the p\_name would need to be the name of the selected name, I imagine it would be something like this:

```auto
def p1_select(p_name):
    if p_name is not None:
        dff = df[df.P == p_name]
        return dash.get_asset_url("\PLImages\"+p_name+".png"), \

```

Can anyone advise as the above doesn’t work

---

<div class="post-metadata">

### Author: ![DrSmith69](https://avatars.discourse-cdn.com/v4/letter/d/ed655f/32.png) [@DrSmith69](https://community.plotly.com/u/DrSmith69)
#### Post date: [July 25, 2022, 6:34pm UTC](https://community.plotly.com/t/dynamic-image-names-in-callback/66428/2 "2022-07-25T18:34:33Z")

</div>

Nevermind, I got it working, had my slashes the wrong way 🤣

working code:

```auto
def p1_select(p_name):
    if p_name is not None:
        dff = df[df.P == p_name]
        return dash.get_asset_url("/PLImages/"+p_name+".png"), \

```
