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

Question

Question

Populating a correction form checkbox field using workflow.

asked on June 18, 2024

Hello I am having a bit of a niche issue.

I have a Registration Form, you can register 6 children for school on the form. In a situation where a reviewer wants to approve each child individually instead of as a family, a workflow splits the Registration Form by calling a "Child Correction Form" up to 6 times with each individual child's information as what populates the Correction Form on each Business Process Invocation.

I finished the main functionality of this but noticed that for parts of the form that had the "Checkbox" field in forms, workflow would not properly populate the Correction Form. The Correction Form would only ever have 1 checkbox filled in, instead of however many the Registrant filled in.
(See Example below)

In workflow you can access the boolean value of each individual checkbox of a checkbox field, but you cannot access the fields themself  on the Business Process you are invoking. Therefore I cannot individually populate the boxes of a checkbox field through workflow.

Example:

I have access to every checkbox option for the child1_contact1_options variable.
%(GrabChild1Values_child1_contact1_options)
%(GrabChild1Values_child1_contact1_options_Receives_Mail_Is Set)
%(GrabChild1Values_child1_contact1_options_Can_Pickup_Child_Is Set)
%(GrabChild1Values_child1_contact1_options_Parent_Portal_Access_Is Set)
%(GrabChild1Values_child1_contact1_options_Restricted_View_Is Set)

On the correction form I only have access to

correction_contact1_options

Capture.PNG
Capture.PNG (4.46 KB)
0 0

Answer

SELECTED ANSWER
replied on September 19, 2024 Show version history

Just wanted to give an update on this. 

Using the link below I found that checkboxes are in the format of: [VALUE, VALUE2, ect]. If you want to grab the entire array of values you need to use the Token Calculator tool to sub out those spaces so that the output is in the format of [VALUE,VALUE2,ect] before setting that value to the business process variable. 

Invoke business process with a collection of checkbox values - Laserfiche Answers

I found that the brackets were causing issues with the first and last values of the checkbox, so I also added the following regex expression: [^[][^]]* to my checkbox tokens.

Summary:

Starting value - checkboxToken

Token Calculator Sub - SUBSTITUTE(%(checkboxToken), ", ", ",")

Token Editor - Apply Regular Expression [^[][^]]*

 

Example Use

Invoke Business Process value prepopulation - 

correction_contact1_options=%(TokenCalculator_checkboxToken#<[^[][^]]*>#)

 

0 0

Replies

replied on June 18, 2024

You should be able to do something like this, which is taking the multi-value token from the original form's field and pushing it as is into the new form's field.

correction_contact1_options=%(GrabChild1Values_child1_contact1_options)

Assuming the list of options on the checkboxes are identical on both forms, this should work because it is taking the list of checked boxes from one and putting that same list into the other.

0 0
replied on June 20, 2024 Show version history

Thank you for your reply! I should have added a bit more information. So originally I had done this, and assumed that it just worked. But then later when I was edge case hunting I noticed that this code snip would lose information.

correction_contact1_options=%(GrabChild1Values_child1_contact1_options)

To more clearly show what the issue is I attached before and after images below. Honestly I am starting to believe that this is a bug within Laserfiche.

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

Sign in to reply to this post.