# Programmatically create json hierarchy

**URL:** <https://forum.inductiveautomation.com/t/programmatically-create-json-hierarchy/82920>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [December 8, 2023, 10:48pm UTC](https://forum.inductiveautomation.com/t/programmatically-create-json-hierarchy/82920 "2023-12-08T22:48:31Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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:** [December 9, 2023, 5:08am UTC](https://forum.inductiveautomation.com/t/programmatically-create-json-hierarchy/82920/5 "2023-12-09T05:08:09Z")

</div>

I got it.

I literally, copied the code below.  
The input is a column from dataset with `completePath'.  
Work like a charm.  
Thank you for replying to my post quick.

> [@Text tree to Tree component 'items' property](https://forum.inductiveautomation.com/t/text-tree-to-tree-component-items-property/75453/2):
>
> I've been using a modified version of this: I'm using this code in a script transform. Original binding is to a dataset containing path data. ex: "A/B/C" items = [] for row in range(value.rowCount): path = value.getValueAt(row, 0) current = items for part in path.split("/"): # Check if the current folder exists in our items list folderExists = False for itemsPointerItem in current: if part == itemsPointerItem['label']: folderExists = True current = itemsPointerItem['ite…

---

_[View the full topic](https://forum.inductiveautomation.com/t/programmatically-create-json-hierarchy/82920)._
