Skip to main content

Append DataTable

Appends all rows from a second DataTable to a first DataTable. Both tables must have the same column structure. This node is ideal for combining datasets from multiple sources.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Input

  • First Table - First DataTable to append to (base table)
  • Second Table - Second DataTable whose rows will be appended to the first table

Output

  • Table - Combined DataTable containing all rows from both tables

Behavior

  • The output table has the same column structure as the first table
  • All rows from the first table are preserved in their original order
  • All rows from the second table are added after the first table's rows
  • Both tables must have matching column structures (same column names)
  • The original tables remain unmodified; a new combined table is returned

Example Usage

Combining Sales Data from Multiple Months

// January sales table
// Columns: ["Date", "Product", "Quantity", "Amount"]
// 100 rows of January data

// February sales table
// Columns: ["Date", "Product", "Quantity", "Amount"]
// 95 rows of February data

// After appending: Combined table with 195 rows
// Rows 0-99: January data
// Rows 100-194: February data

Merging Data from Multiple Files

// Read data from file 1
var table1 = /* Read from CSV file 1 */;
// 50 customer records

// Read data from file 2
var table2 = /* Read from CSV file 2 */;
// 75 customer records

// Append tables
// Result: Single table with 125 customer records

Accumulating Data in a Loop

// Initialize an empty result table
var resultTable = /* Create DataTable with columns */;

// Process multiple data sources
var dataFiles = ["data1.csv", "data2.csv", "data3.csv"];

for (var i = 0; i < dataFiles.length; i++) {
var tempTable = /* Read CSV from dataFiles[i] */;

// Append each file's data to the result
// First Table: resultTable
// Second Table: tempTable
// Output becomes the new resultTable
}

// Final resultTable contains all data from all files

Combining Filtered Results

// Get active customers
var activeCustomers = /* Filter DataTable where Status = 'Active' */;
// 200 rows

// Get premium customers
var premiumCustomers = /* Filter DataTable where Tier = 'Premium' */;
// 50 rows

// Combine both groups
// Result: 250 rows total

Tips

  • Both tables must have identical column structures - same column names
  • Column order doesn't need to match, but column names must be the same
  • Use this node instead of Merge DataTable when you want to stack rows vertically
  • For horizontal combination (adding columns), use Merge DataTable instead
  • The operation is non-destructive - original tables are preserved
  • Efficient for combining large datasets from multiple sources

Common Errors

Empty First Table Error

Error: First table cannot be empty. Please provide a valid DataTable.

Solution: Ensure the first table input contains a valid DataTable object.

// Wrong - first table is null or undefined
var firstTable = null;

// Correct
var firstTable = /* Valid DataTable from Create DataTable or other source */;

Empty Second Table Error

Error: Second table cannot be empty. Please provide a valid DataTable.

Solution: Ensure the second table input contains a valid DataTable object.

// Wrong - second table is null or undefined
var secondTable = null;

// Correct
var secondTable = /* Valid DataTable from another source */;

Column Mismatch

If the two tables have different column structures, the append operation may fail or produce unexpected results.

// Table 1 columns: ["Name", "Age", "Email"]
// Table 2 columns: ["Name", "Age", "Phone"] <- Different structure!

// This will cause issues because "Email" != "Phone"

// Solution: Ensure both tables have the same columns
// Or use Remove Column / Add Column to match structures first

Difference from Merge DataTable

  • Append DataTable: Stacks rows vertically (union of rows)

    • Same columns, different rows
    • Result row count = Table1 rows + Table2 rows
  • Merge DataTable: Combines both rows and columns

    • Can have different columns
    • Merges data based on matching schemas

See Also