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

Discussion

Discussion

Retrieve checkbox choices instead of values

posted on August 8, 2024

I have a checkbox with 35 different choices.  Most of the choices are long, over 25+ characters.  The value for each checkbox choice is 3 chars long.  Once the form is completed, I need to send an email that basically says "These are the choices that were selected".  I saved the form to the repository and then called a workflow where I am retrieving the form's business process variables.  I can retrieve the values of the selected checkboxes into a multivalue token and then display them in the email.  But it shows the values of the checkbox instead of the choices.  

It looks something like this...

I need to be able to show the corresponding choice from the checkbox.  It would look like this...

We ask that you provide the following:

Private Testing

Note taking assistance

A meeting with student to discuss alternative forms of oral in-class participation

Blood sugar monitor may sound during class

 

Is there a way to show the choices instead of the values of the checkbox?

0 0
replied on August 9, 2024

While it's not trivial, you can do this by mapping the codes to their values in Workflow.  There are (at least) three ways I can think of:

  1. Using a Conditional Decision activity with 35 branches (annoying to configure, but easy)
  2. Using a Data Query activity to look it up against a database (complicated, may be slower, but doesn't require configuring 35+ activities)
  3. Using a Script activity (requires some basic programming skills)


The rough idea of #1 would look something like this:
1) Use Assign Token Values to create an empty multivalue token to hold the display values
2) Use a For Each Value to iterate through the code values (depending on how these are stored, you may need to use a Split token function first)
3) Use a Condition Decision activity with a branch for each value to be replaced
4) In each branch, use Assign Token Values to append the display value to the empty token you created in step 1

In this example, I'm replacing ABC/DEF/GHI with 123/456/789:

Pro tip: name your Conditional Decision activity something meaningful and then collapse it with the [-] to hide all the branches

0 0
replied on August 9, 2024

Jacob, we are definitely on the same page! smiley

I just finished creating multivalued token to hold the values and another to hold the display values (choices).  I can For/Each my way through the values and when there is a match I'm using the iteration token to deliver the matching display value.  This will get the form done and delivered short term.  Since there is a chance that those codes, which actually live in our student system, will be added to at some point, we are creating a lookup back into the student system.  That way I'm pulling from the source and won't have to make changes in several places if/when the codes change.

Thanks for the pro tip on collapsing the branches.  I'd seen that countless times before but I'm not sure that I've ever collapsed them.  It makes it much easier to look at!

1 0
replied on August 9, 2024

Sounds good, just wanted to make sure you knew it was possible after Zac's answer didn't work out

0 0
replied on August 9, 2024

Thanks for that example Zachary.  I'm using the classic designer so things are going to be a bit different.  I don't actually store the selected choices anywhere on the form.  When I call the workflow from the form, I retrieve the form's business process variables.  I just reference the checkbox there which gives me the selected values.  It would be beneficial if I could select whether I wanted the values or choices at that point...or maybe both.  Maybe something for v12?

0 0
replied on August 8, 2024

You'd likely need an additional field to store the selected choices and use that for the email as I'm assuming you need the 3 digit choice values for another part of the process. Check this answer for more details.

 

https://answers.laserfiche.com/questions/221443/Modern-Layout-Designer-javaScript-get-text-of-selected-option

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

Sign in to reply to this post.