# Script to Build Component Structure 8.0.4

**URL:** <https://forum.inductiveautomation.com/t/script-to-build-component-structure-8-0-4/28642>\
**Category:** Ignition\
**Tags:** ignition80, scripting\
**Created:** [September 29, 2019, 2:08am UTC](https://forum.inductiveautomation.com/t/script-to-build-component-structure-8-0-4/28642 "2019-09-29T02:08:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![miyanalu](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@miyanalu](https://forum.inductiveautomation.com/u/miyanalu)\
**Post date:** [September 29, 2019, 2:08am UTC](https://forum.inductiveautomation.com/t/script-to-build-component-structure-8-0-4/28642/1 "2019-09-29T02:08:48Z")

</div>

I need help figuring out how to use some scripting to build property structures with JSON. For example in the exchange click to graph item, you need to build the following properties  
{  
“filters”: {  
“endDate”: null,  
“mode”: “realtime”,  
“mostRecent”: {  
“units”: “min”,  
“value”: 5  
},  
“pollRate”: {  
“units”: “min”,  
“value”: 1  
},  
“startDate”: null,  
“showOverlay”: false  
},  
“tags”: []  
}

thanks

---

<div class="post-metadata">

**Author:** ![heybales](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/heybales/32/3358_2.png) [@heybales](https://forum.inductiveautomation.com/u/heybales)\
**Post date:** [September 30, 2019, 6:44pm UTC](https://forum.inductiveautomation.com/t/script-to-build-component-structure-8-0-4/28642/2 "2019-09-30T18:44:50Z")

</div>

You’ll want to create a dictionary. See this page in the user manual.  
[https://docs.inductiveautomation.com/display/DOC80/Dictionaries](https://docs.inductiveautomation.com/display/DOC80/Dictionaries)

Once you have the structure you need, call system.util.jsonEncode to convert the dictionary to a json string.  
[https://docs.inductiveautomation.com/display/DOC80/system.util.jsonEncode](https://docs.inductiveautomation.com/display/DOC80/system.util.jsonEncode)
