# Write to OPC UDT tag arrays

**URL:** <https://forum.inductiveautomation.com/t/write-to-opc-udt-tag-arrays/61306>\
**Category:** Ignition\
**Created:** [June 28, 2022, 4:10pm UTC](https://forum.inductiveautomation.com/t/write-to-opc-udt-tag-arrays/61306 "2022-06-28T16:10:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Davide\_Bortolini](https://avatars.discourse-cdn.com/v4/letter/d/3e96dc/32.png) [@Davide\_Bortolini](https://forum.inductiveautomation.com/u/Davide_Bortolini)\
**Post date:** [June 28, 2022, 4:10pm UTC](https://forum.inductiveautomation.com/t/write-to-opc-udt-tag-arrays/61306/1 "2022-06-28T16:10:44Z")

</div>

Hi, I’m trying to write to an OPC UDT using derived tag and jsonGet/jsonGet functions.  
I’ve setup mu OPC tag as Document type and the tag contains an array of elements like this:

[  
{  
“i\_conformityResult”: 1  
},  
{  
“i\_conformityResult”: 0  
}  
]

Then I’ve setup a derived tag to read/write the first element with these read/write expressions:  
Read jsonGet({source}[0],“i\_conformityResult”)  
Write jsonSet({source}[0],“i\_conformityResult”,{value})  
The data type is Int

As expected reading tag works fine as I get the first element value, but when I try to write some values I get this error message:

Error writing to Test.value: Bad(“Bad\_TypeMismatch: The value supplied for the attribute is not of the same type as the attribute’s value.”)

I guess it’s an issue with UDT structure but I’m unable to sort it out.

Thanks for helping

Davide
