> 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-item-to-collection.md).

# Add Item to Collection

## Description

This is a function that allows a particular value or data object to be added to a collection. It is specified in a process node. The editor is located in the dropdown menu for the "collections" item in the top bar menu of the process node editor.

## Use

The function is used to create the value in a specified or next available position within a collection.

## Tips and Tricks

This part can be used to generate a list of items (e.g. recommendations) based off user inputs. Using the LogicNets Assessment framework, create a report net with rules that check for user inputs, and when true, use *add to collection* part to add a recommendation (text) to the collection (e.g. called list\_of\_recommendations). Multiple rules and recommendations can be placed in the net, such that the logicnet model will create the custom list of recommendations based on what rules were true.

Watchout: given that the LogicNets Assessment framework cycles through all nets on each user click, you will need to *initialize* the collection at the top of the report net to insure it starts out as empty. Use the *Delete data object* process step for this. Without this step recommendations under the true leg of each rule will get added on each click and you'll see that in the output as duplicated values.

## Editor Fields

| Field Name   | Description/Use                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | Type/Options | Optional/Mandatory |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------ |
| Data Object  | This is the data object the system will insert into a collection. Specify a pre-existing data object to be stored within a target collection. You can include the compound form of the data object using the convention *\[Group Name].\[Object Name]*, in which case the following Group field can be left blank. Instead of typing the data object name, click the ellipses button to the right and then select a data object from the data model the system displays.                          | Text         | Mandatory          |
| By reference | When this is checked the system will insert the reference to the data object instead of a copy of the data-object.                                                                                                                                                                                                                                                                                                                                                                                | Checkbox     | Optional           |
| Group        | This is the group containing the data object to be inserted into a collection. Specify the group containing the data object you specified in the first parameter. This field is left blank if either there is no group to which the data object specified in the field above belongs OR if the group name has been specified in the field above as part of a compound data-object name.                                                                                                           | Text         | Optional           |
| Collection   | <p>This is the collection into which the system will insert a data object from the first parameter. Specify a pre-existing collection into which the data object from parameter one will be inserted.<br>The collection name can be chosen from the data model by pushing the ellipses button to the right.</p>                                                                                                                                                                                   | Text         | Mandatory          |
| Position     | <p>This is the position in the collection into which the system will insert the data object.<br>This can be left empty and the value will be inserted in the next available position by default.<br>Alternatively, specify the numeric position within the collection into which the data object will be stored. This field can be left blank if the user has specified the position in the previous parameter using the <em>$(collection\_name)\[position#]</em> compound naming convention.</p> | Number       | Optional           |

## Example

Download and import [this](/release-9/example-gallery/example-projects-for-parts/add-change-or-remove-item-from-collection.md) example 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-item-to-collection.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.
