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

Question

Question

"Is in" Workflow decision

asked on March 22, 2018

Hi All,

 

I have a Workflow that does a SQL DB lookup which I then need to pass a Routing Decision. As seen below in the snippet, 

 

What seems to happen, as the Custom Query is returning Multiple Values at times, I thought using the "Is In" would be able to find that it matches one of the results and allow it to go through as a match, but looks like it is bypassing this option and always going through the other Decision which just hardcodes the first value retrieved if nothing matches. 

What is it that I am missing to make sure it goes through the above condition if the Query does return multiple values that it finds? I know and can see there are matches to the Query, but not sure how to set it? Should there be an additional retrieve Tokens? and if so, what would the condition change to then? 

 

Thank you in advance, 

Ziad

 

0 0

Replies

replied on March 22, 2018

The condition is unable to "iterate" through each of the results in that way. In my experience, the most effective solution would be the following:

  1. Create a multivalue token to store the values
  2. For each row -
    1. loop through each result from the query
    2. append the current value to the multivalue token
  3. After the loop
    1. Create another token and set it store the "flattened" value of the multivalue token (i.e., open the token editor, select "Apply Index > all values separated by"
  4. Instead of using IS IN, flip it around and check if your "flattened" token CONTAINS the target value.

 

2 0
replied on March 22, 2018 Show version history

Hi Ziad,

If the query is to return multiple rows, have you tried using a for each row activity? I would create a multi value token and then append that token with the for each row value that it finds. You might be able to use your conditional decision after this?

 

edit: added workflow. Similar to what Jason has posted below, but the condition route is checking whether the Multi value token contains a specific word.

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

Sign in to reply to this post.