> For the complete documentation index, see [llms.txt](https://community-test.logicnets.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://community-test.logicnets.com/release-9/platform-documentation/process-node-parts/add-data-records.md).

# Add Data Records

## Description

This part offers an easy way for you to insert a data collection into a data table in the database. It is used to store data that is organized as a matrix or array, with each "column" being a different data object and each "row" being a different set.

## Use

The principle use for this part is to add a group of similar records to a data table **in one step**, instead of cycling through the records and adding each one to a table individually.

This part is often used to store data that has been collected in a user-facing application with a Smartgrid or any application where the user answers the same set of questions for different business objects. A simple example of the kind of data structure suited to this would be collecting inputs for US states, where the user provides their answers for the capitol city, population, and land mass for each state. Using the *Add Data Records* part you can store all 50 rows of data into a table, where each component is saved into its own column.

It is available the *Data table* dropdown menu in a process node and is compatible in all LogicNets frameworks as well as in projects created without a framework.

## Editor Fields

| Field Name                              | Description/Use                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Type/Options | Optional/Mandatory |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------ |
| Collection                              | This is the name of the data collection you want to insert into the data table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Text         | Mandatory          |
| Data source                             | This is the name of the data table into which you want to insert the data.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | Text         | Mandatory          |
| Columns                                 | <p>This is where you specify each column into which a record should be inserted and the component of the collection that should be inserted.<br>In the part editor, the <em>Data object</em> column should contain <strong>only</strong> the data object name identified in the collection--without using the $(...) construction. Note that this is different from the <em>Add Data Record</em> (single row) part, which specifically requires the user to define the correct data object using $(...).<br>A useful shortcut is to click on the \[...] and the system will prepopulate the (table) column and data object fields for the full table. You can then remove those columns you do not want to update.<br>Advanced Note: You CAN include other variables using $(...) syntax that will populate the SAME information in all rows. This is useful for adding a reference ID alongside all the table row entries.</p> | Collection   | Mandatory          |
| Support multi-level column data-objects | <p>By default, the system indexes the column data objects (the input for the add records) in the collection using the format <em>collection\[i]\[data-object]</em>. Check this checkbox to support dots in the column data object to index a sub-container element in the collection.<br>This is only required with more complex data model structures.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Checkbox     | Optional           |
| Log data object                         | <p>This is the data object that stores the error messages from the execution of the database parts: add data record, get data record, update data record, delete data record, and import values. If you specify the log data object, the system stores the error message and stack trace of a database part to the object if there are errors when you run the part. See the image below.<br>When used by multiple database parts, the Log data object stores the cumulative list of error messages from the different parts.</p>                                                                                                                                                                                                                                                                                                                                                                                               | Text         | Optional           |
| Reset log data object                   | When you check this checkbox, the system will clear the error messages from the Log data object. Typically, you should check this option in the first database part of a series of database parts.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Checkbox     | Optional           |
| Skip on error                           | When you check this checkbox, the system skips the execution of subsequent database parts linked to the same Log data object.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | Checkbox     | Optional           |

#### Log Data Object Image

![](https://2802811211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdFhfexCjZ5JMhwGzzywq%2Fuploads%2Fgit-blob-c28644b8a3374e31cdee732522e28278f966160c%2F5870e670-e7a3-4939-b0b5-e0791a84bf54.png?alt=media)

## Tips and Tricks - Large Data Tables (10+ columns)

In addition to its primary purpose of writing multiple sets of data to a table, you can use this part to simplify the design process of writing a single record to a large table, a table with more than 10 columns.

When you use *Add Data Record* (single) each column must be populated with a data variable referenced using the $(...) construction, and you have to type them in manually. This is time consuming for large data sets, so you can use *Add Data Records* and update the table with ONE data set. The part works with any number of sets, including when there is only one set in the collection.

This shortcut requires that the variable names and the column names match. If so, use the \[...] shortcut (1) to prepopulate the part (2) with one click.

![](https://2802811211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdFhfexCjZ5JMhwGzzywq%2Fuploads%2Fgit-blob-619ba25a1955f53d118d1961c5603c1de5eeab16%2Fe207a012-0e20-4701-b3ca-ac70c9f58374.jpg?alt=media)

Any data you want to write to the large table needs to be put into the first set of a collection, e.g. update\_dataset\[1]. Write user inputs to update\_dataset\[1].object1, update\_dataset\[1].object2, etc. before using the *Add Data Records* part to add the entire update\_dataset collection to your target table.

## Example

Download and import the following [example](/release-9/example-gallery/example-projects-for-parts/add-data-records-example-project.md) project in your workspace.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://community-test.logicnets.com/release-9/platform-documentation/process-node-parts/add-data-records.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
