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

Question

Question

Use results from a Query in a conditional decision

asked on July 16, 2020 Show version history

Hi,

I am trying to simplify a conditional decision action in a WF.

I have a multi value token and I'm attempting to pass the results of a SQL query to this token and then use the token in a conditional decision.

I'm not getting the results I am expecting.  Any suggestions/ideas?

 

UPDATE TO THIS QUESTION:

I have updated my condition to use "Is In" instead, however, it appears I have to add each item individually.  Can this be added as one token with individual items delimited by a comma or similar?  This way I can pass my query results in a multi value token straight into the "IS IN" condition.  Fingers crossed this is possible :)

Anthony 

0 0

Answer

SELECTED ANSWER
replied on July 16, 2020 Show version history

Hi Anthony,

Try doing the remove duplicates in another token, and then using the new token for the conditions.

And then just %(TokenNoDuplicates#[; ]#) in the conditional.

 

Alternatively, if Document_Types is the direct query result, you may need to loop through the result's rows and add them to a separate token, since they might be counted as rows and not token values (and then not a multi-value token).

 

Side note: I would hesitate comparing the values this way since certain values will cause it to match when they are not the full value. So for example, if you're checking if "apple" is in the list of "banana; orange; pineapple; strawberry" it will match despite apple itself not being in the list.

If possible, I would recommend passing the value you are testing into the SQL query to compare there.

0 0
replied on July 16, 2020

Hi Jim,

Thank you for your reply and suggestion.  I had tried that and didn't get any success, I'm afraid.  As and update, I have updated my condition to use "Is In" instead, however, it appears I have to add each item individually.  Can this be added as one token with individual items delimited by a comma or similar?  This way I can pass my query results in a multi value token straight into the "IS IN" condition.

 Anthony

0 0
replied on July 16, 2020

Hang on, is Test_Token a multi-value token too?

0 0
replied on July 16, 2020

No.  I have just used a token so I can pass some demo text to check my WF is working.

0 0
replied on July 16, 2020

Then I'm not sure what you mean. Did you try doing my 2nd suggestion of a For Each Rows and adding them into a different token?

0 0
replied on July 16, 2020

I have a SQL table/view which is being used in a number of templates to manage Dynamic Fields.  Within this table/view there are over 600 different document types.  I am trying to add these to a Condition Clause on the fly without the need to hard code every one of them in:

 

 

It doesn't look like I can use a multi-value token for the "IS IN" part of the condition.  

0 0
replied on July 16, 2020

I was able to get it working previously but I don't still have the workflow, so I know it's possible. Without going through your workflow myself I don't see where the error is.

Are you able to compare it in SQL instead? You can filter it to only the columns with the document type equaling your comparing value, and then check either the Results Found token or Result Count > 0.

1 0
replied on July 16, 2020

Oh I do feel stupid!  Of course, compare it in SQL first.

I was overthinking this solution  - thank you for being the voice of reason.

Anthony

0 0
replied on July 16, 2020

Haha happens to everyone. Glad I could help!

1 0

Replies

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

Sign in to reply to this post.