> 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/count-sum-items-in-collection.md).

# Count Sum Items in Collection

## Description

The list\_count part returns the count, sum, or iterated count of items in a single or multi-dimensional array.

## Use

You can use this part to gain insight into the data held in a collection. When you choose the SUM mode, the part cycles through a simple collection of items (1...2....etc.) and presents the sum of those items when the item is numeric. When you choose COUNT or ITERATED COUNT, the system counts the number of items cycled through based on their index (count) or non-indexed (iterative count) nature.

When the count of items in a collection equals zero, this indicates the collection is empty. This can be a useful variable to incorporate into a rule that can be used in directing the pathway (if the collection is not empty, then process items in the collection, otherwise proceed down alternative path). Note that for indexed collections (collection\[1].item, collection\[2].item....) it is more efficient to just check whether the first item is empty (collection\[1].item is not "")

## Tips and Tricks

This part should only be used with collections (arrays). If you are working with groups/containers, then use the group calculations part to count items. (See the article [here](/release-9/platform-documentation/process-node-parts/group-calculations.md)).

Using the DATA tab, you can identify whether your data model is using collections or groups/containers as follows:

```
[ ] interest_level            [ ] signifies collection
#1 = "football"                #1 signifies first position in the collection
#2 = "golf"                    You can reference the value 'golf' as $(interest_level[2])

{ } interest_level            {  } significies a group or container
        sport = "football"        objects within the group are indented.
                                  You can reference this value as $(interest_level.sport)
```

## Editor Fields

| Field Name             | Description/Use                                                                                                                                     | Type/Options | Optional/Mandatory |
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------ |
| Data object            | Object name where the returned value will be stored.                                                                                                | Text         | Mandatory          |
| Collection             | Name of the collection containing the object items to be counted or summed up.                                                                      | Collection   | Mandatory          |
| Mode                   | Selector allowing the choice of count or sum or iterated count.                                                                                     | Dropdown     | Mandatory          |
| Value field            | This option only applies to SUM mode. Specify the particular (numeric) dimension in the array to calculate the sum of all values of that dimension. | Text         | Optional           |
| Big number calculation | Checking this box enables the part to sum across "big numbers" - those that cannot be represented in 32 bits.                                       | Checkbox     | Optional           |

## Example

Download and import the following [example](/release-9/example-gallery/how-to-guides/how-to-guide-introduction-to-collections.md) project in your workspace. This example is the How to Guide for Collections and focuses on sum and count on one of the tabs.


---

# 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/count-sum-items-in-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.
