How-to: Iterate through Multi-select control's selected items

  • 31 August 2016
  • 1 reply
  • 56 views

Badge +1

I have a multi-select box with a dozen locations--the options come from a smart object/SharePoint list which has additional info on each item, including an email address for a POC--these are stored in a single line text field--not as a "person/group."  

 

When a person submits the form, the values selected  are saved as they should be with semicolons between them in a single field.. What I need to do next is use that field in a workflow to build a Send Email's CC field.

 

So here's what I mean:

 

List: 

Location: Anchorage  | POC:    Bob@anchorage.net

Location: Kodiak  | POC: Bob @outlook.com

etc.

 

In the workflow, I have a field containing   "Anchorage;Kodiak"  I need to iterate through it and add the email addresses to the CC line. I cannot make the email addresses the "value" that gets saved on the form b/c there is actually another item I push there, which must be captured.

 

Is the "For each" option right for items collected within a field? Any guidance would be appreciated!

 

-Jeff


1 reply

Badge +6

I would definitely use the for each option and make your list of locations the source. I would imagine you would be able to use the "next item" and do a read or list lookup to then get the email of that location. Next I think you would most likely have to build another data field that contains the emails i.e. for each location append the email onto the string e.g. "Bob@email.com;Mark@email.com;Steve@email.com". Once you have this string it would be placed in the CC of the email event.

 

http://help.k2.com/onlinehelp/k2appit/userguide/current/Default.htm#Thin_Client_Wizards/General_Wizards/For_Each/For_Each.htm%3FTocPath%3DCreate%7CWorkflow%7CWorkflow%2520Steps%7CWorkflow%2520Wizards%2520%7CGeneral%2520Wizards%7C_____8

Reply