--- title: "Sum Grouping of Values from Array of Item" slug: "sum-grouping-of-values-from-array-of-item" updated: 2021-03-12T15:05:23Z published: 2021-03-12T15:07:04Z canonical: "documentation.decisions.com/sum-grouping-of-values-from-array-of-item" --- > ## Documentation Index > Fetch the complete documentation index at: https://documentation.decisions.com/llms.txt > Use this file to discover all available pages before exploring further. # Sum Grouping of Values from Array of Item Example Lab ArticleWhile Example Lab projects are resources for public use, articles and assets are not actively maintained. Screenshots and features are from the specified version below. These references may become dated as new versions are released. --- ## Overview | ## Example Lab Details | | --- | | **Version** | 6.10.1 | | **Root Folder** | Example Lab - Sum Grouping of Values from Array of Items | | **Modules** | None | | **Dependencies** | None | This Example Lab demonstrates how to group dynamic object items with the same value on a field called "Code", and then loop for each of those groupings in order to Sum the values from the list of the other field called "Value". --- ## Explanation This Flow works by taking in a list of objects called Test Example with an Int32 value and a String value. The **For-Each** step groups the items by "Code" and then loops through the groups that are made. The Flow is set up to pass all of the values in the **Sum Values in Each Group** step while going through the new list grouping; this occurs so the Flow can sum the list of values from the current grouping of "Code" in order to get the main value for all items that have the same "Code". The Flow then adds a new item with the new sum of values to a list that can be passed to the new list (of each "Code" type, including related values) as an output array. View the output array (from running the unit test) to see that the list only contains one item for each "Code" grouping with the sum value of all original Items. Reference Articles[For Each in Group Step](https://documentation.decisions.com/docs/for-each-in-group-step) [Creating Defined Data Structures](https://documentation.decisions.com/docs/creating-defined-data-structures-advanced) ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-148.png) --- ## Project Download The examples attached were developed to be instructional and were not developed as officially supported components. For more information or to engage our service team to develop fully supported, production quality solutions, please contact services@decisions.com. Import the project below to a Decisions environment on version 6.10.1 or later using our [Importing/Exporting](https://documentation.decisions.com/docs/exporting-and-importing-overview) article. [ExampleLab[SumGroupingofValuesfromArrayofItems].zip](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/ExampleLab%5BSumGroupingofValuesfromArrayofItems%5D.zip) ---