# Parameterizing a filepath in an expression?

**URL:** <https://forum.inductiveautomation.com/t/parameterizing-a-filepath-in-an-expression/66718>\
**Category:** Ignition\
**Created:** [November 20, 2022, 12:25am UTC](https://forum.inductiveautomation.com/t/parameterizing-a-filepath-in-an-expression/66718 "2022-11-20T00:25:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![IgnitionNewbie](https://avatars.discourse-cdn.com/v4/letter/i/94ad74/32.png) [@IgnitionNewbie](https://forum.inductiveautomation.com/u/IgnitionNewbie)\
**Post date:** [November 20, 2022, 12:25am UTC](https://forum.inductiveautomation.com/t/parameterizing-a-filepath-in-an-expression/66718/1 "2022-11-20T00:25:39Z")

</div>

![parameterize a filepath](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/2/62648bcba861cd0c55072208c67740e93b3f2fff.png)

Im trying to use the parameter `{Recipe}` to fit it in a filepath

the filepath is `{[.]../TCP SLOW PSI GP1/Query[0,2]`

but no matter what i try it doesnt like the syntax  
is it even allowed?

Here are some of the attempts

```auto
{[.]../+{Recipe}+GP1/Query[0,2]}
{[.]../+"{Recipe}"+GP1/Query[0,2]}
"{[.]../"+"{Recipe}"+"GP1/Query[0,2]}"
"{[.]../" "{Recipe}" "GP1/Query[0,2]}"

```

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [November 20, 2022, 3:14am UTC](https://forum.inductiveautomation.com/t/parameterizing-a-filepath-in-an-expression/66718/2 "2022-11-20T03:14:41Z")

</div>

You can not have nested `{}` in an expression.

Officially you can use the `tag()` expression to accomplish this. it isn’t always the best approach however.

```auto
tag("{[.]../"+{Recipe}+"GP1/Query[0,2]}")

```

Where are you attempting to do this, there may be a better way?

---

<div class="post-metadata">

**Author:** ![IgnitionNewbie](https://avatars.discourse-cdn.com/v4/letter/i/94ad74/32.png) [@IgnitionNewbie](https://forum.inductiveautomation.com/u/IgnitionNewbie)\
**Post date:** [November 20, 2022, 3:50am UTC](https://forum.inductiveautomation.com/t/parameterizing-a-filepath-in-an-expression/66718/3 "2022-11-20T03:50:07Z")

</div>

it is in an expression tag , trying to make a tag that takes a single row out of the 2nd column out of a bunch of different tables and it changes depending on a recipe name , then it adds them all together and divides by the amount of tables to get an average

any chance this works for getting the 2 to be a parameter as well?

tag("{[.]../"+{Recipe}+"GP1/Query[0,{column}]}") something like this?

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [November 20, 2022, 4:34am UTC](https://forum.inductiveautomation.com/t/parameterizing-a-filepath-in-an-expression/66718/4 "2022-11-20T04:34:14Z")

</div>

Where are the parameters coming from?

In theory I think you would want something like:

```auto
tag("[.]../"+{Recipe}+"GP1/Query")[0][{column}]

```

The `tag()` expression takes a string tag path, so you’re building that string.

---

<div class="post-metadata">

**Author:** ![IgnitionNewbie](https://avatars.discourse-cdn.com/v4/letter/i/94ad74/32.png) [@IgnitionNewbie](https://forum.inductiveautomation.com/u/IgnitionNewbie)\
**Post date:** [November 20, 2022, 5:15am UTC](https://forum.inductiveautomation.com/t/parameterizing-a-filepath-in-an-expression/66718/5 "2022-11-20T05:15:40Z")

</div>

the parameters are coming from a UDT , they are recipe , profile number , and now column if i can get that to work , ill have to test it on monday

---

<div class="post-metadata">

**Author:** ![IgnitionNewbie](https://avatars.discourse-cdn.com/v4/letter/i/94ad74/32.png) [@IgnitionNewbie](https://forum.inductiveautomation.com/u/IgnitionNewbie)\
**Post date:** [November 21, 2022, 4:03pm UTC](https://forum.inductiveautomation.com/t/parameterizing-a-filepath-in-an-expression/66718/6 "2022-11-21T16:03:32Z")

</div>

after a bit of tries i got it to work thank you

it ended up being  
(Tag("[.]../"+{Recipe}+" "+"GP1/Query[0,2]")

i was forgetting to add a + " " + in between for a spacer
