# Integration Toolkit Solutions Wiki

**URL:** <https://forum.inductiveautomation.com/t/integration-toolkit-solutions-wiki/105080>\
**Category:** 3rd Party Modules\
**Tags:** scripting, ignition81\
**Created:** [April 14, 2025, 9:02pm UTC](https://forum.inductiveautomation.com/t/integration-toolkit-solutions-wiki/105080 "2025-04-14T21:02:36Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 14, 2025, 9:28pm UTC](https://forum.inductiveautomation.com/t/integration-toolkit-solutions-wiki/105080/2 "2025-04-14T21:28:20Z")

</div>

## Perspective Table Data and Columns Config from Datasets

When using the JSON return format in a Named Query, the column order and original column datatypes are lost. You can move a Named Query binding to a custom property of the component or view, then use this simple iteration expression to deliver the jsonified content to the table:

> **Binding on props.data**
>
> ```javascript
> forEach(
> {path.to.source.dataset.prop},
> asMap(it())
> )
> 
> ```

> **Binding on props.columns (optional)**
>
> ```javascript
> forEach(
> columnsOf({path.to.source.dataset.prop}),
> if(
> it()[0] = 'special_column_name',
> asMap(
> 'field', it()[0],
> 'sortable', true,
> 'editable', true,
> 'filter', asMap('enabled', true, 'visible', 'on-hover'),
> 'resizable', true //,
> // 'header', asMap('title', replace(runScript(concat("'",it()[0],"'",'.title()')),'_',' ')), // don't do this
> // 'render', it()[1] // not necessary (ds column types are implicit)
> // add additional properties as needed
> ),
> asMap('field', it()[0])
> )
> )
> 
> ```
> 
> @pturmel - can we get a `title()` function?

> **Features employed**
>
> - [Iterables](https://www.automation-pros.com/toolkit/doc/iteration.html#iterables) General behavior of all iterators.
> - [`forEach()`](https://www.automation-pros.com/toolkit/doc/iteration.html#foreach) Loops through the dataset, calling the nested expression with one row at a time.
> - [`it()`](https://www.automation-pros.com/toolkit/doc/iteration.html#it) Delivers the one row in dataset format (same column names and types as the source).
> - [`asMap()`](https://www.automation-pros.com/toolkit/doc/iteration.html#asmap) Converts the first row of the dataset it is given into a mapping (dictionary) of key-value pairs.
> - [`columnsOf()`](https://www.automation-pros.com/toolkit/doc/datasets.html#columnsof "columnsOf()"): gets column names (and types)

---

_[View the full topic](https://forum.inductiveautomation.com/t/integration-toolkit-solutions-wiki/105080)._
