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

Question

Question

How to merge 3 multi-valued fields into 1 single multi-valued filed

asked on January 8, 2019

I have three single multi=valued fields as follows:

 

Vehicle: car

            bike

            boat

             train

Max Speed:120

                    40

                    65

                     85

Use Mode of Transportation :yes

                                               no

                                               maybe

                                               when I have time

 

and I need to generate the following

User Options: car-120-yes

                       bike-40-no

                        boat-65-maybe

                        train-85-when I have time

 

I have tried using a for-each value with the Vehicle as the value

and I have tokes tracking both Max Speed and Use Mode of Transportation

 

But I can not print the index values correctly.

 

Any help would be appreciated.

0 0

Replies

replied on January 8, 2019 Show version history

You can iterate over just one of the tokens and then use the iteration number as an index value on all three.

The for each value iterates on just vehicle, then combine them within the loop in another multivalue token, (or how ever you will be using them).   If you are placing the results into another multivalue token, declare it outside of the loop and modify it inside the loop.  Otherwise you will only get the last result.


%(veh#[%(ForEachValue_Iteration)]#) - %(max#[%(ForEachValue_Iteration)]#) - %(mode#[%(ForEachValue_Iteration)]#)

car - 120 - yes
bike - 40 - no
boat - 65 - maybe

1 0
replied on January 8, 2019

One thing to remember is that if you are dealing with tokens of different length, you want to iterate over the one with the most values and handle the case of the missing values. Keep in mind that Workflow will use the last non-empty value if you try to index it past the last value.

1 0
replied on January 8, 2019

I was able to figure this out just after posting, and will also try your suggestion if it simplifies what I cam up with.

 

 

2019-01-08_13-07-48.png
0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.