Skip to main content
Nintex Community Menu Bar
Solved

Add column values using Collection

  • November 1, 2016
  • 5 replies
  • 216 views

Forum|alt.badge.img+8

Hi,

 

Here is my scenario:

 

I would like to Query list and return certain numbers into a collection variable and add all the numbers in the collection variable and store the resulting sum in a variable.

 

Is this possible? if so, how?

 

Please help.

Best answer by kapilkjoshi

Hi

Once you have the collection from Query action, create a For Each loop. Create a variable called varSum of type number. 

Inside loop (for each number in the collection), Add Math function. It would look like this: 

Workflow variable varSum + num (from collection) , save in varSum.

When the loop finishes you will have the sum of all numbers. Hope that helps.

5 replies

Forum|alt.badge.img+11
  • Rookie
  • Answer
  • November 2, 2016

Hi

Once you have the collection from Query action, create a For Each loop. Create a variable called varSum of type number. 

Inside loop (for each number in the collection), Add Math function. It would look like this: 

Workflow variable varSum + num (from collection) , save in varSum.

When the loop finishes you will have the sum of all numbers. Hope that helps.


Forum|alt.badge.img+11
  • Rookie
  • November 9, 2016

Reference to similar question. 

perform math operation on collection 

Were you able to resolve the issue?


Forum|alt.badge.img+8
  • Author
  • November 10, 2016

Hi Kapil,

Thank you for your response. I was able to resolve this.


Hi, I have a list with a category column. I need to add values of few column in the list as per category. I don't think using foreach is a good idea as there are 8 to 10 categories, Is there any way I can add all the items in a collections ?


Forum|alt.badge.img+1
  • July 4, 2021

Hi Sunil

 

I have a similar situation. Were you able to resolve your issue?

 

Thanks Ren