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

Question

Question

How conditions can compare if 2 multi value tokens are equal

asked on April 27, 2014

Hello,

 

As stated here, only the first value is considered when a multi value token apprears at the right side of a condition. I need this time to compare if each value (position by position) of 2 multi value tokens are equal. Is there a existing syntax or do I need to program an SDK activity if not a workflow for that purpose?

0 0

Answer

SELECTED ANSWER
replied on April 28, 2014

Workflow does not have any built-in conditions for set operations currently, so you will have to script it.

0 0
replied on October 7, 2014 Show version history

I am not a scripter but I need to compare two multi-value tokens to see if they equal.. I just ran into the fact that it only uses the first value on the right side of the condition check. Is this something that could be sent to me or am I going to have to become a coder just to compare two multi-value fields?

My use case is that I have hidden history fields that contain copies of the regular multi-value field and I keep comparing against them when Entry Changed - Template Field Set to see if it's that field that changes. I need to compare all values in the history field against all values in the original field and then I send a notification when the they are no longer equal.

0 0
replied on October 7, 2014

If you are determined not to code what you can do is use 2 'For Each Value' Activities on each of your multi-valued tokens. Since you only want to compare the first position in the first token with the first position in the second, in your conditional you want to check if the values are not equal when the iterations are equal. If the values are ever unequal, you can go ahead and and send the notification because it means the token is unequal. 

I put together a sample workflow of what it might look like, which creates a token 'False' whenever the values are not the same. 

I'd also recommend scripting but if you're determined this is a workaround.

CompareMultiValueTokens.png
4 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.