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

Question

Question

Workflow Multi-Value Token Condition

asked on September 12, 2014

 I have a workflow that adds value to a multi-value token in a loop. While in this loop, I check to see if a value is contained in that multi-value token, but I'm getting inconsistent results. Here is what I mean:

 

1st check: [TRUE] Entry Token [DocOwner]: The token value is empty <does not contain>

2nd check: [FALSE] Entry Token [DocOwner]:  'JudyW' <does not contain> 'JudyW'

3rd check: [TRUE] Entry Token [DocOwner]:  'JudyW' <does not contain> 'davidn'

4th check: [TRUE] Entry Token [DocOwner]:  'JudyW', 'davidn' <does not contain> 'davidn'

5th check: [TRUE] Entry Token [DocOwner]:  'JudyW', 'davidn', 'davidn' <does not contain> 'JudyW'

6th check: [TRUE] Entry Token [DocOwner]:  'JudyW', 'davidn', 'davidn', 'JudyW' <does not contain> 'JudyW'

 

It seems to me the last three checks should all produce a false, but they are not. What am I doing wrong?

2 0

Answer

SELECTED ANSWER
replied on September 12, 2014 Show version history

"Contains"/"Does not contain" conditions on multi-value tokens are not likely to work as expected for you as they are checked on individual values. The 4th condition translates to "Is there a value in the multi-value token that does not contain 'davidn'?". "JudyW" satisfies that.

 

Edit: to check if a given string is in a multi-value token, the easiest way is to first "flatten" the multi-value token. Create a separate token that is set to, say, a comma or @ delimited list of the values in the first token.

 

 

Then use this new token on the left side of the operator in your conditions above.

8 0
replied on September 12, 2014 Show version history

Thanks for the clarification. I did however switch the two branches and changed it to contains, and that did work the way I expected.

 

Reading your additions, I'm not sure this should be working. Am I setting myself up by fixing it the way I did? Also, what is the syntax you are using in the value for Token3? I don't quite understand it.

0 0
replied on September 12, 2014

Contains should be OK since as long as one of the values contains the string it will be fine. "Does not contain" is the more problematic one since it is checked as "is there a value that does not contain X" rather than "none of the values contain X". You can set it to equals if you want an exact match on one of the values in the multi-value token.

 

Tokens support in-line formatting and regular expressions. If you right-click on any token, you'll an option to open the Token Editor.

 

0 0

Replies

replied on September 12, 2014

What version of Workflow are you using? You can apply a function to the token and remove duplicates. 

0 0
replied on September 12, 2014

Workflow 9.1. I'm not sure what removing values would help with.

0 0
replied on September 12, 2014

well, if you have a token with all the values and you apply the function to remove duplicates, then you wouldn't need to loop through the token when creating the multi-value token, you would already have the output you were looking for in the end.

 

2 0
replied on January 8, 2018

Kenneth--I know this is arriving a few years late, but thank you! This is exactly what I need!

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

Sign in to reply to this post.