AnsweredAssumed Answered

Error Using ForEach Collections from SharePoint List multivalue choice field

Question asked by doug.allen on Mar 6, 2016
Latest reply on Jan 29, 2018 by Ranjith kumar

I'm new to using Nintex but I think I have everything right that's obvious but its not working and I'm getting frustrated.  I have a simple list that has a multi-value choice field (checkboxes).  In my workflow, I want to get the selected choices from the item, cycle through each one and send an email or do other actions per value.  So like this:

 

Assign Current Item: Category to Collection

Count collection

If 0, add a stnd value to the collection of index 0

else count >0, continue

foreach value in the collection

     Run on collection variable

     Output variable is TEXT variable "EachCategory"

     Output index variable is integer "EachCategoryIdx"

Get item from collection

     index of item to get - "EachCategoryIdx

     output item to variable - "EachCategory" (I've tried creating a separate one too)

Log to history

     Value: "EachCategory"

 

The workflow goes Suspended with the error "An unhandled exception occurred during the execution of the workflow instance. Exception details: System.FormatException: Input string was not in a correct format.   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal"

 

If I remove the get item from collection, it doesn't error but I can't get the text label of the choice value.  So there's some type of mismatch, but what gives?  the value should be text right?  It's like it's trying to output the value as the integer or something.  Ok I just changed the get item from collection output to a integer variable and that errored too.  Am I doing something stupid wrong, or is this a bug?

 

I dumped the count and collection to the history, and it shows this: Count: 2; Collection: {"__metadata":{"type":"Collection(Edm.String)"},"results":["Blog","Video"]}.  What I need is to get the "Blog" and "Video" values.

 

Any help would be appreciated - Doug

Outcomes