# 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:** 25

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [November 13, 2025, 1:51pm UTC](https://forum.inductiveautomation.com/t/integration-toolkit-solutions-wiki/105080/25 "2025-11-13T13:51:43Z")

</div>

# Adding Columns to a Dataset where the Column Data is derived from expressions

The [selectStar()](https://www.automation-pros.com/toolkit/doc/datasets.html#selectstar) expression can be used to add one or more columns to a data set. As implied by the name this expression is roughly equivilent to a `SELECT * FROM Table1` query in SQL. The advantage here is that the expression iterates through each row, allowing you to derive a new columns value from other data in the table.

Obviously the data expression does not need to reference the existing data. Any valid expression which returns the correct datatype can be used.

> **Example Expression Single Column**
>
> ```python
> selectStar(
> {path.to.originalDataset},
> asMap('New Column', 'I'),
> it()['Column 1'] + 10
> )
> 
> ```

> **Example Expression Multiple Columns**
>
> ```python
> selectStar(
> {path.to.originalDataset},
> asMap('New Column', 'I','New Column 2','I'),
> it()['Column 1'] + 10,
> it()['Column 1'] * 10
> )
> 
> ```

> **Features Used**
>
> - [selectStar()](https://www.automation-pros.com/toolkit/doc/iteration.html#foreach) Adds columns to a dataset with row-by-row computation of the contents of the new columns.
> - [asMap()](https://www.automation-pros.com/toolkit/doc/iteration.html#asmap) Creates a map of the list of key-value pairs.
> - [it()['columnName']](https://www.automation-pros.com/toolkit/doc/iteration.html#it) Delivers a cell value based on the column name.

Phil: I often use `selectStar()` when I need an original row index to be retained through a `where()` operation. Something like this:

```python
where(
    selectStar(
        {path.to.original.data},
        asMap('original_row_idx', 'I'),
        idx()
    ),
    ... some condition ...
)

```

---

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