# Dynamic Tag Path Issue

**URL:** <https://forum.inductiveautomation.com/t/dynamic-tag-path-issue/102724>\
**Category:** Ignition\
**Tags:** scripting, perspective\
**Created:** [February 22, 2025, 1:52am UTC](https://forum.inductiveautomation.com/t/dynamic-tag-path-issue/102724 "2025-02-22T01:52:32Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![jacob1](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@jacob1](https://forum.inductiveautomation.com/u/jacob1)\
**Post date:** [February 22, 2025, 1:52am UTC](https://forum.inductiveautomation.com/t/dynamic-tag-path-issue/102724/1 "2025-02-22T01:52:32Z")

</div>

Working through the Ignition design challenge and struggling with the following. Attempting to change tag values from a popup window. I have a text box in the popup where you enter a value. Then I have a button that, upon clicking, writes the value you entered to the "brewType" tag. The code I have below is script from the button event configuration, and it worked just fine until I made the tag path dynamic. For example, when path = "[default]Brewing Tags/Station 2/brewType", it works just fine for changing station 2's brew type but only that station. Note, I have also tried making a custom property, binding it to the brewStation parameter, and using that instead of the parameter, that hasn't worked either. I have tested whether or not the parameter and the custom property are correctly receiving the numbers, and they are. But whenever I attempted this as shown below, nothing happens. Any advice?

```python
def runAction(self, event):
	newval = self.getSibling("TextArea").props.text
	path = "[default]Brewing Tags/Station" + {self.view.params.brewStation} + "/brewType"
	system.tag.writeBlocking(path, newval)

```

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [February 22, 2025, 2:13am UTC](https://forum.inductiveautomation.com/t/dynamic-tag-path-issue/102724/2 "2025-02-22T02:13:52Z")

</div>

How are you determining that nothing happens? Have you tried inspecting the output from `writeBlocking`? Have you confirmed that the tag path being created is the one you are looking for?

> [@jacob1](#):
>
> "[default]Brewing Tags/Station 2/brewType"

based on this, you are missing a space in your string.

> [@jacob1](#):
>
> `"[default]Brewing Tags/Station"`

Should be `"[default]Brewing Tags/Station "`

---

<div class="post-metadata">

**Author:** ![jacob1](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@jacob1](https://forum.inductiveautomation.com/u/jacob1)\
**Post date:** [February 25, 2025, 5:02pm UTC](https://forum.inductiveautomation.com/t/dynamic-tag-path-issue/102724/3 "2025-02-25T17:02:53Z")

</div>

When I just use a number value for the station as mentioned, like "Station 2", the brewType tag value will update. When I first established the Station 2 brew type tag, the value was 0. Then, when I enter something simple into my text box like 7 and press my button, the brewType tag value for Station 2 will update to 7. However, when I am using the dynamic path that I listed above, nothing happens. It remains 0.

I tried adding the space to my string and I still get no changes.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 25, 2025, 5:07pm UTC](https://forum.inductiveautomation.com/t/dynamic-tag-path-issue/102724/4 "2025-02-25T17:07:06Z")

</div>

Scripts should not have curly braces around perspective properties. That is expression syntax.

---

<div class="post-metadata">

**Author:** ![vtran](https://avatars.discourse-cdn.com/v4/letter/v/779978/32.png) [@vtran](https://forum.inductiveautomation.com/u/vtran)\
**Post date:** [February 25, 2025, 5:10pm UTC](https://forum.inductiveautomation.com/t/dynamic-tag-path-issue/102724/5 "2025-02-25T17:10:54Z")

</div>

You need to pass lists to `system.tag.writeBlocking` function for your tag paths and values.  
Try `system.tag.writeBlocking([path], [newval])` instead.  
[system.tag.writeBlocking | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-tag/system-tag-writeBlocking)

---

<div class="post-metadata">

**Author:** ![jacob1](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@jacob1](https://forum.inductiveautomation.com/u/jacob1)\
**Post date:** [February 25, 2025, 5:33pm UTC](https://forum.inductiveautomation.com/t/dynamic-tag-path-issue/102724/6 "2025-02-25T17:33:06Z")

</div>

I was basing my notation on the Expression Dynamic Tag Path example under the Using Relative Tag Paths section of this page: [Tag Paths | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/platform/tags/tag-paths)  
Was I misunderstanding this example?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 25, 2025, 5:34pm UTC](https://forum.inductiveautomation.com/t/dynamic-tag-path-issue/102724/7 "2025-02-25T17:34:03Z")

</div>

Yes. Because expressions are not scripts.

---

<div class="post-metadata">

**Author:** ![kvane](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kvane/32/22228_2.png) [@kvane](https://forum.inductiveautomation.com/u/kvane)\
**Post date:** [February 25, 2025, 5:35pm UTC](https://forum.inductiveautomation.com/t/dynamic-tag-path-issue/102724/8 "2025-02-25T17:35:54Z")

</div>

There is a nice User Manual page that highlights the major differences between the 3 major editors you'll find in Ignition:

> **[Scripting Vs. SQL Vs. Expressions | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/platform/scripting/basic-python-troubleshooting/scripting-vs-sql-vs-expressions)**
>
> Expression Language & SQL Queries vs Scripting

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 25, 2025, 5:35pm UTC](https://forum.inductiveautomation.com/t/dynamic-tag-path-issue/102724/9 "2025-02-25T17:35:57Z")

</div>

What Paul said.

But also, that's a terrible example to put in the user manual. It is a Vision UI usage of tag(), which simply should never be done. Perhaps @kvane can alter that to be something typical in an expression tag instead of a UI binding.

---

<div class="post-metadata">

**Author:** ![kvane](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kvane/32/22228_2.png) [@kvane](https://forum.inductiveautomation.com/u/kvane)\
**Post date:** [February 25, 2025, 5:39pm UTC](https://forum.inductiveautomation.com/t/dynamic-tag-path-issue/102724/10 "2025-02-25T17:39:00Z")

</div>

Which page are you looking at Phil? I don't see a UI referenced on the Tag Paths page.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 25, 2025, 5:42pm UTC](https://forum.inductiveautomation.com/t/dynamic-tag-path-issue/102724/11 "2025-02-25T17:42:24Z")

</div>

On that page, under dynamic expression tag path, there is this:

```python
tag("[default]Tanks/Tank "+{Root Container.tankNumber}+"/Level")

```

Anything that shows `{Root Container.....}` is a Vision expression binding in a window.

If that showed something like `{[.]TankNumber}`, that'd be a good example that implicitly indicates it is being used in an expression **tag**.

---

<div class="post-metadata">

**Author:** ![kvane](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kvane/32/22228_2.png) [@kvane](https://forum.inductiveautomation.com/u/kvane)\
**Post date:** [February 25, 2025, 5:44pm UTC](https://forum.inductiveautomation.com/t/dynamic-tag-path-issue/102724/12 "2025-02-25T17:44:12Z")

</div>

Thanks, I see that now, the docs team will have it updated soon.

---

<div class="post-metadata">

**Author:** ![jacob1](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@jacob1](https://forum.inductiveautomation.com/u/jacob1)\
**Post date:** [February 25, 2025, 5:51pm UTC](https://forum.inductiveautomation.com/t/dynamic-tag-path-issue/102724/13 "2025-02-25T17:51:43Z")

</div>

After all of the feedback I have received here I have updated my script to the following.

```python
def runAction(self, event):
	newval = self.getSibling("TextArea").props.text
	path = "[default]Brewing Tags/Station " + self.view.params.brewType + "/brewType"
	self.view.custom.dynamic = path
	system.tag.writeBlocking([path], [newval])

```

My tag still isn't updating, but I added a custom parameter to my view called "dynamic" and set that equal to path, as you can see above. I included a label in my popup window who's text is bound to property I created called "dynamic", so I can see the tag path being created. So this time when I pressed my button, the label updated to "[default]Brewing Tags/Station value/brewType".

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 25, 2025, 5:57pm UTC](https://forum.inductiveautomation.com/t/dynamic-tag-path-issue/102724/14 "2025-02-25T17:57:33Z")

</div>

Are you trying to **monitor** this `brewType` tag, too? (You haven't shown us how you are _reading_ the tag.)

Since you now have `{view.custom.dynamic}` present, you probably need an indirect tag binding that uses that as the definition of `{1}` in the binding.

---

<div class="post-metadata">

**Author:** ![kvane](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kvane/32/22228_2.png) [@kvane](https://forum.inductiveautomation.com/u/kvane)\
**Post date:** [February 25, 2025, 5:59pm UTC](https://forum.inductiveautomation.com/t/dynamic-tag-path-issue/102724/15 "2025-02-25T17:59:24Z")

</div>

I know the challenge and this is correct, you do not need to use scripts for this portion. If you are doing so for testing that is fine, but you should use the indirect tag binding.

---

<div class="post-metadata">

**Author:** ![jacob1](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@jacob1](https://forum.inductiveautomation.com/u/jacob1)\
**Post date:** [February 25, 2025, 6:13pm UTC](https://forum.inductiveautomation.com/t/dynamic-tag-path-issue/102724/16 "2025-02-25T18:13:59Z")

</div>

Maybe I am misunderstanding what you mean by monitor, but I am looking at the tag browser in the ignition designer, so that I can see the tag's current value. I also have a label in the popup with an indirect tag binding to the tag value like this `[default]Brewing Tags/Station {brewStation}/brewType`. When I am not trying to use a dynamic path, both the value in the tag browser and the label I mention here update correctly with the value I want, but neither do when it is a dynamic path.

---

<div class="post-metadata">

**Author:** ![jacob1](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@jacob1](https://forum.inductiveautomation.com/u/jacob1)\
**Post date:** [February 25, 2025, 6:22pm UTC](https://forum.inductiveautomation.com/t/dynamic-tag-path-issue/102724/17 "2025-02-25T18:22:56Z")

</div>

I don't think I understand what you mean, but what you are saying sounds easier than what I am doing so I would like to understand. The popup view section of the challenge says that the popup view should provide a way for users to view and change the name of the current coffee being brewed at the station. I took that to mean that there should be a text box in the popup window where you can enter your desired name and a button that will update the brewType tag value with that desired name. Ignition university made me think that the easiest way to do that would be to configure an event on the onActionPerformed option for the button component, which gets the value entered by in the textbox and sends it to the tag. Does that part sound correct?

---

<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:** [February 25, 2025, 6:29pm UTC](https://forum.inductiveautomation.com/t/dynamic-tag-path-issue/102724/18 "2025-02-25T18:29:45Z")

</div>

> [@jacob1](#):
>
> Ignition university made me think that the easiest way to do that would be to configure an event on the onActionPerformed option

I would say that the easiest method is probably a bi-directional binding on the text box, but since I don’t know the challenge I’m not sure.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 25, 2025, 6:35pm UTC](https://forum.inductiveautomation.com/t/dynamic-tag-path-issue/102724/19 "2025-02-25T18:35:04Z")

</div>

> [@jacob1](#):
>
> [default]Brewing Tags/Station {brewStation}/brewType

Did you define a connection for `{brewStation}`? It isn't valid by itself. As soon as you introduce a curly-brace delimited name or number, the binding UI should place that reference into the row of substitutions below that string. In the row for that substitution, you need to connect to the actual parameter or tag you want there.

(It is typical to use just `{1}` in the indirect binding string to ~~avoid~~ _minimize_ confusion.)

> **[Tag Bindings in Perspective | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/ignition-modules/perspective/working-with-perspective-components/bindings-in-perspective/tag-bindings-in-perspective#indirect-tag-binding-mode)**
>
> A Tag binding is a straight-forward binding type. It simply binds a property directly to a Tag Property (typically the value). This sets up a subscription for that Tag. Every time the chosen Tag changes, the binding is evaluated and pushes the new...

---

<div class="post-metadata">

**Author:** ![jacob1](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@jacob1](https://forum.inductiveautomation.com/u/jacob1)\
**Post date:** [February 25, 2025, 6:44pm UTC](https://forum.inductiveautomation.com/t/dynamic-tag-path-issue/102724/20 "2025-02-25T18:44:31Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/6/26f219f843035a5e1f5cd3390d8aa5c39f5b8820.png)

Yes, I think I understand what you mean, this is the indirect binding I made. I used the same names rather than a `{1}` because the values being put into the tag path would be 1 through 20 so I thought `{1}` would be confusing at first glance.

[Next page](https://forum.inductiveautomation.com/t/dynamic-tag-path-issue/102724.md?page=2)
