# Insert a parameter to path

**URL:** <https://forum.inductiveautomation.com/t/insert-a-parameter-to-path/45700>\
**Category:** Ignition\
**Created:** [April 16, 2021, 7:51pm UTC](https://forum.inductiveautomation.com/t/insert-a-parameter-to-path/45700 "2021-04-16T19:51:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NII](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nii/32/12920_2.png) [@NII](https://forum.inductiveautomation.com/u/NII)\
**Post date:** [April 16, 2021, 7:51pm UTC](https://forum.inductiveautomation.com/t/insert-a-parameter-to-path/45700/1 "2021-04-16T19:51:47Z")

</div>

How should I insert a parameter to the path, eg.:

```auto
path = ["default]mytag_*param1*/role"]
values = ["User"]
system.tag.writeBlocking(path,values)

```

I tried:  
`path = ["default]mytag_"+*param1*+"/role"]`  
it does not work.

---

<div class="post-metadata">

**Author:** ![chandler](https://avatars.discourse-cdn.com/v4/letter/c/e9a140/32.png) [@chandler](https://forum.inductiveautomation.com/u/chandler)\
**Post date:** [April 16, 2021, 8:06pm UTC](https://forum.inductiveautomation.com/t/insert-a-parameter-to-path/45700/2 "2021-04-16T20:06:03Z")

</div>

something like this should work if I understand what you are trying to do:

```auto
path = ["[default]mytag_{}/role".format(param1)]
values = ["User"]
system.tag.writeBlocking(path,values)

```

This is assuming that your script has a variable called param1.  
The format function will fill in the spot of the {} with whatever the value of param1 is.  
here is an example of usage of the format function with several parameters that I executed in a python shell:

```auto
>>> param1 = 'is'
>>> param2 = 'an'
>>> param3 = 150
>>> 'here {} {} example. #{}'.format(param1, param2, param3)
'here is an example. #150'

```

\*edit note:  
You have a typo in your tag path. You forgot the opening square bracket in the tag provider name. I fixed it in the code snippet that I provided above.

---

<div class="post-metadata">

**Author:** ![NII](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nii/32/12920_2.png) [@NII](https://forum.inductiveautomation.com/u/NII)\
**Post date:** [April 16, 2021, 8:21pm UTC](https://forum.inductiveautomation.com/t/insert-a-parameter-to-path/45700/3 "2021-04-16T20:21:49Z")

</div>

Perfect, that works.

Thank you.
