You are viewing limited content. For full access, please sign in.

Question

Question

Only first checkbox value is saving to database

asked on July 13, 2017 Show version history

I have a form that has checkboxes on it that I'm trying to save to a database.

When viewing the instance inside Forms, the variable for the checkbox appropriately shows the selected options.  i.e. Option_B,Option_E,Option_G

After the form is submitted, it kicks off a Workflow that includes a "Retrieve Business Process Variables" activity to get the variables from the form.  Then it uses an "Insert Data" activity to insert the values into the database.

Everything seems to be working well except for one thing.  Only one of the checkbox values are making it into the database.  i.e. the DB will reflect Option_B when I had been expecting Option_B,Option_E,Option_G.

I've confirmed that I'm using the checkbox token - i.e. %(FormDate_Checkbox) and not using the checkbox values tokens - i.e. %(FormDate_Checkbox_Option_B).

Any suggestions how to resolve this so that all selected checkboxes are inserted into the database record?

0 0

Answer

SELECTED ANSWER
replied on July 14, 2017

I think the Forms variable you are using there is being interpreted as a multi-value field, and only the first value is being inserted. If you actually want to insert all of the options as a single comma separated string "option1, option2, option3" you will need to use the token dialog to format the token properly. Token Dialog should be the top option in the token menu when you click on the ">" button in the insert data options. From there, click on the token name in the edit window at the top, then check the "Apply Index" option, and choose "All values separated by Comma"

 

I think that will do what you are looking for.

2 0

Replies

replied on July 13, 2017

Can you add a screenshot of your workflow?

0 0
replied on July 13, 2017 Show version history

Sure.

Here it is high-level.  The two items with black x's are the "Insert Data" activities that are inserting the checkbox values.

Here's the activity to retrieve the values from forms:

The two insert activities are nearly identical, here's one of them:

0 0
replied on July 14, 2017

That was it @████████.  Thank you so much!

I did have to make one small tweak, the "All values separated by Comma" setting is actually separating with a comma and a space, and I did not need or want the space, so I had to tweak the token to remove the space - like this: change from %(FormData_Checkbox#[, ]#) to (FormData_Checkbox#[,]#).

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.