I have a form where I list a bunch of counties and I assigned them values like C1, C2, C3. I would like to write these values to SQL when they are selected. Currently I have them writing to SQL as a single line but I'l like each value checked to be a separate line entry in SQL. Right now I'm reading the values from the template but I've tried the Retrieve Business Process Variables task but I couldn't get that to work either. Here is what I have so far. Thanks
Question
Question
Save Check box values to SQL
Replies
That's likely because you're iterating over a single value token. I'm guessing the field you're reading in Retrieve Field Values is not a multi-value field?
If you create a multi-value token from your "county" field by splitting it on the comma, then you can iterate over this multi-value token and have the individual values of the checkboxes.
Thanks for the response Miruna.
I set the token to a multi value but how would I split by the comma. I've attached screenshots of the workflow. Also should I be using the For Each Value tool? thanks Joel
Sorry for the late reply.
You don't need to create an extra token from the multi-value field. You can use %(RetrieveFieldValues_Service Area_All) directly in For Each Value.
When you set the County field in Insert Data, use the current value token for itgenerated from For Each Value. (You are using %(token 1) which is a multi-value token in a single value field, so Workflow uses the first value of it since it doesn't know which one you want)