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

Question

Question

Associating checked values in multi-value token with different values

asked on December 29, 2015 Show version history

So just a little bit of background with what I'm attempting... cool

Referring to the following thread, I've been able to take values from a set of check boxes, and use this to populate a multi-value token in one of my fields.

But now my question is this - how can I take a set of checked/unchecked values for a multi-token field and convert this to something else?  For example, if the first check box is associated with one value (in this case an injury to a certain body part), the second another, and so forth, how could I translate the true/false (checked/unchecked) values to something else?

The first thought that came to mind was to run the multi-valued field through a "For Each Row" activity, but it seems like with doing this, I'd have to have a multiple If statement, which basically says, "If the first value is true, assign this; if the second value is true, assign this" (and so on).  I also thought of possibly populating a database table with the various values (each matching a column name), and from there running through each checked value, and if true, returning the value of that column?  (This idea coming from these two posts: Post #1, Post #2)

Please let me know if I'm on the right track, or if I'm completely out to lunch on this - thanks!

Marty Gaffney - Network Technician

Town of Okotoks

@ablfguy

0 0

Replies

replied on January 4, 2016

Hi Marty,

You're definitely on the right track. Here is an example of how I use the true/false values:

Create two multi-value tokens: ‘Body Parts List’ and ‘Body Parts Injured.’ The list would just be the body parts in order, the injured one would be blank. Then in the loop, if the check box value equals true, append the correct body part to 'Body Parts Injured', using the loop's iteration number to index the 'Body Parts List':

The result is a multi-value token of "Body Parts Injured", and I only had to use one conditional in the loop. This is just one example of how to go about it. Let me know if this works for you!

2 0
replied on August 10, 2016

Marty, saw this while searching for a different answer for you. :)

 

I used to do this in Quickfields all the time and used Pattern Matching for it. The trick is to put the new values into the input of the pattern match and then use pattern matching IF statements to list all the possible permutations.. so it might look something like this: (note i'm taking most of this off of memory but it should get you in the right direction.

 

Checkbox 1: Big Option

Checkbox 2: Little Option

 

Tokens : Check1, Check2 (and these would be either True of False values)

If this was that only one of these two check boxes would be true and to make a token for Big Option and Little Option which was the wordage you wanted to keep.

Pattern Matching Activity:

Input:

%(Check1)Big Option%(Check2)Little Option

Pattern:

True(Big Option)|True(Little Option)

That way it'll only keep the wordage you are looking for. You have the wordage because you inserted it into the input already.


Cheers

1 0
replied on January 8, 2016

What you mentioned here completely makes sense, however the issue I'm having is with the multi-value token being pulled from the source .pdf, I can only use a pattern to select the fields that I'm using (which is why I used head1, head2...head6, I realize I didn't mention that above).  

If there was a way to select multiple fields, for a multi-value token, that *didn't* depend on a matching pattern, that might be what I need - and from there, I could probably use what you posted above and actually pipe the multi-value token to something useful. cool

Thanks again for any suggestions you may have.

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

Sign in to reply to this post.