Skip to main content

I have a field in my list called "Choice".   When completing the form, the user can pick from one to a number of choices.

In a workflow, what I need to do is get a summary count for each Choice in the list.

Any easy ways to do this?

I had two thoughts on how to do this and both seem ugly.

1.  Maintain two collections.   One a list of unique Choices.   The section collection would be the total for a particular choice.

2.  Create a temporary list of the Choice and a column for the total for that Choice.

Are  you trying to get the count of the selected choices using a list workflow. You can get the choice field to a collection variable and use collection operation to get the count of the choices.


Thanks.    If I understand you correctly, that would give me the total amount of choices which I know how to do.  What I need is a total of each unique choice.

Say my list looks like this:

A

C

A

B

B

My totals would be

A = 2

B=2

C=1


I ended up solving this myself and it was not too bad.   What I really needed to do was to create a summary table as part of a CSV file.    Here is how I did it.

First I queried my choice list in order of choice.   I looped through the collection and counted the choices till the choice changed.   When the choice changed, I logged the total in my CSV file, reset the counter and started all over.


Reply