# Custom Property Object to JSON

**URL:** <https://forum.inductiveautomation.com/t/custom-property-object-to-json/26371>\
**Category:** Ignition Early Access\
**Created:** [July 9, 2019, 3:37am UTC](https://forum.inductiveautomation.com/t/custom-property-object-to-json/26371 "2019-07-09T03:37:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jayce.oxton](https://avatars.discourse-cdn.com/v4/letter/j/8e8cbc/32.png) [@jayce.oxton](https://forum.inductiveautomation.com/u/jayce.oxton)\
**Post date:** [July 9, 2019, 3:37am UTC](https://forum.inductiveautomation.com/t/custom-property-object-to-json/26371/1 "2019-07-09T03:37:36Z")

</div>

I’m trying to pass a custom property object into a named query that calls a stored proc that is expecting a JSON string. When I do this in my scripting I get an error because there is extra text in the JSON string.

Here is an image of the custom property.  
 ![custom%20property](https://us1.discourse-cdn.com/inductiveautomation/original/2X/e/ef764163636b3285514afd58f0bdf5daf442917a.png)

And here is an image of what the data looks like when I send it to the logger.

 ![logger%20data](https://us1.discourse-cdn.com/inductiveautomation/original/2X/6/6b77994469ff307250996952c51048e8251a55d9.png)

As you can see there is a lot of extra data in the string that isn’t displayed in the customer property. I’m wondering how best to get this data into a JSON string without the extra data.

---

<div class="post-metadata">

**Author:** ![md.szyman](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/md.szyman/32/9240_2.png) [@md.szyman](https://forum.inductiveautomation.com/u/md.szyman)\
**Post date:** [July 9, 2019, 11:57am UTC](https://forum.inductiveautomation.com/t/custom-property-object-to-json/26371/2 "2019-07-09T11:57:03Z")

</div>

That’s because the values are being turned into Qualified Values, which have a Value, Quality and Timestamp attached. To get JUST the value, you can use `.value`.

[There’s documentation on Property Change Scripts](https://docs.inductiveautomation.com/display/DOC80/Perspective+Property+Change+Scripts) that talks about getting just the value from a QV.

---

<div class="post-metadata">

**Author:** ![jayce.oxton](https://avatars.discourse-cdn.com/v4/letter/j/8e8cbc/32.png) [@jayce.oxton](https://forum.inductiveautomation.com/u/jayce.oxton)\
**Post date:** [July 9, 2019, 12:55pm UTC](https://forum.inductiveautomation.com/t/custom-property-object-to-json/26371/3 "2019-07-09T12:55:02Z")

</div>

I tried wcgJSON.value and I get an error stating:  
“###Fatal-Traceback (most recent call last): File “function:runAction”, line 19, in runAction AttributeError: ‘array.array’ object has no attribute ‘value’”.

I’m assuming there is an easy way to do this rather than go through each item in the parameter and building the JSON structure.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [July 9, 2019, 2:29pm UTC](https://forum.inductiveautomation.com/t/custom-property-object-to-json/26371/4 "2019-07-09T14:29:06Z")

</div>

```auto
import json
custom_onj = {}
custom_obj.update([(k, v.value) for k, v in self.custom.wcgJSON] )
my_json = json.dumps(custom_obj)
# SQL stuff here

```

Something like this should work, although I make no promises for the syntax.
