# Change tag ParameterValue

**URL:** <https://forum.inductiveautomation.com/t/change-tag-parametervalue/38982>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [September 23, 2020, 3:40pm UTC](https://forum.inductiveautomation.com/t/change-tag-parametervalue/38982 "2020-09-23T15:40:16Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![flavien](https://avatars.discourse-cdn.com/v4/letter/f/f475e1/32.png) [@flavien](https://forum.inductiveautomation.com/u/flavien)\
**Post date:** [September 23, 2020, 3:40pm UTC](https://forum.inductiveautomation.com/t/change-tag-parametervalue/38982/1 "2020-09-23T15:40:16Z")

</div>

Hi,

I would like to change a ParameterValue I’ve called “nb\_hours” in a UDT instance tag.

Example :

```auto
configs = system.tag.getConfiguration("[test]pathtomytag",True)

configs[0]['parameters']['nb_hours']['value']=5

```

I have an error “‘com.inductiveautomation.ignition.common.tags.config.properties.ParameterValue’ object is unsubscriptable”.

Can you help me ?

---

<div class="post-metadata">

**Author:** ![bpreston](https://avatars.discourse-cdn.com/v4/letter/b/4af34b/32.png) [@bpreston](https://forum.inductiveautomation.com/u/bpreston)\
**Post date:** [September 23, 2020, 4:46pm UTC](https://forum.inductiveautomation.com/t/change-tag-parametervalue/38982/2 "2020-09-23T16:46:31Z")

</div>

When you run system.tag.getConfiguration, it returns a list of tag dictionaries related to your tag. You can’t just write back to that list. You can take that list and modify it then use [system.tag.configure()](https://docs.inductiveautomation.com/display/DOC80/system.tag.configure) to write back to your tag. The last example in system.tag.configure looks close to what you were trying to do there except you added [‘value’] to it so I’m assuming you have more to your script your not sharing?

---

<div class="post-metadata">

**Author:** ![flavien](https://avatars.discourse-cdn.com/v4/letter/f/f475e1/32.png) [@flavien](https://forum.inductiveautomation.com/u/flavien)\
**Post date:** [September 24, 2020, 8:59am UTC](https://forum.inductiveautomation.com/t/change-tag-parametervalue/38982/3 "2020-09-24T08:59:16Z")

</div>

Thanks  
It's not for UDT Definitions but for UDT instances.

Below my try :

```auto
path="[test]pathtomytag"
configs = system.tag.getConfiguration(path)

configs[0]['parameters']['nb_hours']=5
print configs[0]['parameters']

system.tag.configure(path, configs, 'o')

```

Return :

> {u'device\_id': {datatype=String, value=17}, u'nb\_hours': 5, u'serial\_number': {datatype=String, value=null}, u'device\_name': {datatype=String, value=null}, u'database': {datatype=String, value='db'}, u'project\_id': {datatype=String, value=2}}

> [Bad\_Unsupported("The target path '[test]pathtomytag' does not have item 'pathtomytag' for overrides, and cannot accept children tags.")]

---

<div class="post-metadata">

**Author:** ![bpreston](https://avatars.discourse-cdn.com/v4/letter/b/4af34b/32.png) [@bpreston](https://forum.inductiveautomation.com/u/bpreston)\
**Post date:** [September 24, 2020, 1:22pm UTC](https://forum.inductiveautomation.com/t/change-tag-parametervalue/38982/4 "2020-09-24T13:22:00Z")

</div>

I don’t have an 8.0 system in front of me right now to try it out but what about something like:

```auto
path="[test]pathtomytag"

param = {"parameters":{"nb_hours":5}}

system.tag.configure(path,[param],"m")

```

Instead of trying to update everything about it, I’m just specifying the parameter you want to change and then using the “m”(merge) collisionPolicy.

---

<div class="post-metadata">

**Author:** ![flavien](https://avatars.discourse-cdn.com/v4/letter/f/f475e1/32.png) [@flavien](https://forum.inductiveautomation.com/u/flavien)\
**Post date:** [September 25, 2020, 7:21am UTC](https://forum.inductiveautomation.com/t/change-tag-parametervalue/38982/5 "2020-09-25T07:21:11Z")

</div>

With your code I have : [Error\_Configuration]

---

<div class="post-metadata">

**Author:** ![flavien](https://avatars.discourse-cdn.com/v4/letter/f/f475e1/32.png) [@flavien](https://forum.inductiveautomation.com/u/flavien)\
**Post date:** [December 4, 2020, 12:07pm UTC](https://forum.inductiveautomation.com/t/change-tag-parametervalue/38982/6 "2020-12-04T12:07:39Z")

</div>

Hi,

My script still not work. I didn’t found any solution for instance.  
Do you have a solution ?

---

<div class="post-metadata">

**Author:** ![flavien](https://avatars.discourse-cdn.com/v4/letter/f/f475e1/32.png) [@flavien](https://forum.inductiveautomation.com/u/flavien)\
**Post date:** [April 9, 2021, 7:52am UTC](https://forum.inductiveautomation.com/t/change-tag-parametervalue/38982/7 "2021-04-09T07:52:01Z")

</div>

Hi,

Do I have to upgrade Ignition to fix this problem ?

Thanks,

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [April 9, 2021, 10:45am UTC](https://forum.inductiveautomation.com/t/change-tag-parametervalue/38982/8 "2021-04-09T10:45:09Z")

</div>

Pretty sure you need to pass the parent path to configure, not the path to the actual tag

Here we go

 ![Screenshot_20210409-201659_Chrome](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/0/c01ca4ab1095a5a54edb4a524254fe8aa3ba307f.jpeg)

EG set basePath to  
`'/'.join(path.split('/')[:-1])`

You could probably also use a proper tag path library to get the parent path as well… Just in case your tagpath doesn’t contain any folders

---

<div class="post-metadata">

**Author:** ![mpaulson745](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@mpaulson745](https://forum.inductiveautomation.com/u/mpaulson745)\
**Post date:** [August 18, 2021, 2:05pm UTC](https://forum.inductiveautomation.com/t/change-tag-parametervalue/38982/9 "2021-08-18T14:05:13Z")

</div>

I had the same issue in a script I wrote before Inductive added datatypes to UDT parameters. You can no longer just assign a value directly to a parameter. You’ll need to use the “setValue” method.

So change your script to this:

```auto
configs[0]['parameters']['nb_hours'].setValue(5)

```

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [August 18, 2021, 5:11pm UTC](https://forum.inductiveautomation.com/t/change-tag-parametervalue/38982/10 "2021-08-18T17:11:25Z")

</div>

The other thing is that you can simply write to the UDT instances’ parameters directly using `system.tag.writeBlocking(['path/UDTInstance/Parameters.Param1'], [10])`

---

<div class="post-metadata">

**Author:** ![Eugene49](https://avatars.discourse-cdn.com/v4/letter/e/c6cbf5/32.png) [@Eugene49](https://forum.inductiveautomation.com/u/Eugene49)\
**Post date:** [May 23, 2025, 8:15pm UTC](https://forum.inductiveautomation.com/t/change-tag-parametervalue/38982/11 "2025-05-23T20:15:18Z")

</div>

> [@nminchin](#):
>
> The other thing is that you can simply write to the UDT instances’ parameters directly using `system.tag.writeBlocking(['path/UDTInstance/Parameters.Param1'], [10])`

This is nice if it work, but I got error:

```python
File "<function:runAction>", line 14, in runAction ValueError: 
Invalid path element '[default]B100/Water_Table2.Parameters.OpcServer': Token PROPERTY_SEPARATOR found after property name.

```

---

<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:** [May 23, 2025, 8:16pm UTC](https://forum.inductiveautomation.com/t/change-tag-parametervalue/38982/12 "2025-05-23T20:16:23Z")

</div>

`path/UDTInstance/Parameters.NameOfParameter`, **not** `path/UDTInstance.Parameters.NameOfParameter`.

You can only have one `.` separating elements in a tag path.

---

<div class="post-metadata">

**Author:** ![Eugene49](https://avatars.discourse-cdn.com/v4/letter/e/c6cbf5/32.png) [@Eugene49](https://forum.inductiveautomation.com/u/Eugene49)\
**Post date:** [May 23, 2025, 8:18pm UTC](https://forum.inductiveautomation.com/t/change-tag-parametervalue/38982/13 "2025-05-23T20:18:26Z")

</div>

That is Awesome!
