# Combining the data.selection.data of two perspective tables into a single table to export to csv

**URL:** <https://forum.inductiveautomation.com/t/combining-the-data-selection-data-of-two-perspective-tables-into-a-single-table-to-export-to-csv/38151>\
**Category:** Ignition\
**Tags:** ignition80, perspective\
**Created:** [August 28, 2020, 12:07am UTC](https://forum.inductiveautomation.com/t/combining-the-data-selection-data-of-two-perspective-tables-into-a-single-table-to-export-to-csv/38151 "2020-08-28T00:07:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mitchell-ACS](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mitchell-acs/32/30062_2.png) [@mitchell-ACS](https://forum.inductiveautomation.com/u/mitchell-ACS)\
**Post date:** [August 28, 2020, 12:07am UTC](https://forum.inductiveautomation.com/t/combining-the-data-selection-data-of-two-perspective-tables-into-a-single-table-to-export-to-csv/38151/1 "2020-08-28T00:07:47Z")

</div>

I’m sure this is going to end up being an easy problem, but for the life of me I cannot get the data types to work together.  
I have two tables that I am selecting cells from, and I need to combine the selected cell into a third table for verification before exporting the file.

Unfortunately, up to this point I keep running into transform errors where it won’t allow me to take the first PyArray and combine it with the second.

Any help is appreciated, thanks!

---

<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:** [August 28, 2020, 12:18pm UTC](https://forum.inductiveautomation.com/t/combining-the-data-selection-data-of-two-perspective-tables-into-a-single-table-to-export-to-csv/38151/2 "2020-08-28T12:18:07Z")

</div>

There are several ways you could set this up, but it’s important that both tables have the same columns.

This example uses a direct Expression Structure binding:

 ![Screen Shot 2020-08-28 at 5.12.30AM](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/f/cf68897f41dc40662f46d586e015bd5317128792.png)

Then, once those Tables used in the Expression Structure begin having selections made:

 ![Screen Shot 2020-08-28 at 5.11.48AM](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/3/7335ee625e4389db20af2df8ae1aee6cec4446de.png)

---

<div class="post-metadata">

**Author:** ![mitchell-ACS](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mitchell-acs/32/30062_2.png) [@mitchell-ACS](https://forum.inductiveautomation.com/u/mitchell-ACS)\
**Post date:** [August 28, 2020, 2:53pm UTC](https://forum.inductiveautomation.com/t/combining-the-data-selection-data-of-two-perspective-tables-into-a-single-table-to-export-to-csv/38151/3 "2020-08-28T14:53:36Z")

</div>

@cmallonee I should have explained better that what I would like to do is add the columns of the two tables to be combined.  
For example table one has a single column of first\_name, table two has a single column of last\_name. So on my combined table I want two columns of first\_name, and last\_name using the selected data from the first two tables.

---

<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:** [August 28, 2020, 3:04pm UTC](https://forum.inductiveautomation.com/t/combining-the-data-selection-data-of-two-perspective-tables-into-a-single-table-to-export-to-csv/38151/4 "2020-08-28T15:04:26Z")

</div>

Python’s `zip()` function is the tool you need.

---

<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:** [August 28, 2020, 3:06pm UTC](https://forum.inductiveautomation.com/t/combining-the-data-selection-data-of-two-perspective-tables-into-a-single-table-to-export-to-csv/38151/5 "2020-08-28T15:06:03Z")

</div>

Same setup, but modify the script:

 ![Screen Shot 2020-08-28 at 8.04.38AM](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/e/8e048b4fc10d61e533fc6a4da3085dcf2861a8b2.png)

When using this script the tables do not need to have the same columns because you’re defining the columns in the dict yourself.
