# Not being able to add UDT parameters through scripting

**URL:** <https://forum.inductiveautomation.com/t/not-being-able-to-add-udt-parameters-through-scripting/94423>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [August 9, 2024, 2:56pm UTC](https://forum.inductiveautomation.com/t/not-being-able-to-add-udt-parameters-through-scripting/94423 "2024-08-09T14:56:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Muhammad\_Saim](https://avatars.discourse-cdn.com/v4/letter/m/7ab992/32.png) [@Muhammad\_Saim](https://forum.inductiveautomation.com/u/Muhammad_Saim)\
**Post date:** [August 9, 2024, 2:56pm UTC](https://forum.inductiveautomation.com/t/not-being-able-to-add-udt-parameters-through-scripting/94423/1 "2024-08-09T14:56:19Z")

</div>

Hello

I'm having issues adding parameters to my UDTs through scripting and I'm not quite sure why. The parameter {opcServer} shows up after running the code, but it doesn't show it in italics. It shows up literally as {opcServer} instead of as a parameter. I've attached the code example below.

Thank you!

````python
def createUDTs2():
	udtName = "GarbageUDT"
	parameters = {
	    "nameSpace": "",
	    "siteCode": "",
	    "siteID": "",
	    "number": "",
	    "version": "",
	    "opcServer": ""
	}
	
	provider = "default"
	system.tag.addTag(parentPath="", name=udtName, tagType="UDT_DEF", parameters=parameters)
	
	opcItemPath = "path"
	namespace = "nsu=something;s="
	siteID = "siteID"
	number = "0001"
	tagName = "Milk"
	folderName = "folder"
	opcServer = "OPC"

	attributes = {
        "OPCItemPath": opcItemPath,
        "OPCServer": "{opcServer}"
    }

	system.tag.addTag(
	    parentPath="[default]_types_/GarbageUDT",
	    name=tagName,
	    tagType="OPC",
	    dataType="Float4",
	    attributes=attributes
	)```
````

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [August 9, 2024, 3:20pm UTC](https://forum.inductiveautomation.com/t/not-being-able-to-add-udt-parameters-through-scripting/94423/2 "2024-08-09T15:20:43Z")

</div>

~~Not sure where you're getting `system.tag.addTag`, but that's not even an available function. (You're not using ChatGPT are you?)~~

To create tags using scripting you need to use `system.tag.configure`

> **[system.tag.configure | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-tag/system-tag-configure)**
>
> Creates tags from a given list of Python dictionaries or from a JSON source string.

Edit: I found that this is a deprecated function, so I would try to stick with the current methods that are supported.
