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

Question

Question

Is 10 Greater than or Equal to 7?

asked on October 22, 2015

I have a workflow that has a conditional decision where it evaluates if a given token is greater than or equal to 7. The token is derived from the entry name and set as a token. When I test the workflow, it is saying the month token of 10 is not greater than or equal to 7 and goes down the wrong path.

I have added the track tokens activity and can see that for the month token, it did give it a value of 10. On the condition tab for that instance, I see the following message:

Any ideas on how to get it seeing 10 is greater than 7?

1 0

Answer

SELECTED ANSWER
replied on October 22, 2015

Pattern matching tokens would be treated as strings. What you can do is use a separate "Assign Token Values" activity to assign the PM token to a new token. For this new token, use the "Token Tags" option to tag it as an integer instead of a string.

1 0

Replies

replied on October 22, 2015

Is the Month token cast as a number? Comparing tokens in conditions can give unexpected results if they're not both cast as the same type.

1 0
replied on October 22, 2015

I am honestly not sure how to check that. The token is created using Pattern Matching with the below settings.

1 0
SELECTED ANSWER
replied on October 22, 2015

Pattern matching tokens would be treated as strings. What you can do is use a separate "Assign Token Values" activity to assign the PM token to a new token. For this new token, use the "Token Tags" option to tag it as an integer instead of a string.

1 0
replied on October 22, 2015

That did it. Thank you!

1 0
replied on October 22, 2015 Show version history

Blake - My first guess would be that you need to store the tokens as numerics instead of text.  As text '10' is actually less than '7' because strings are evaluated character by character left to right.

 

0 0
replied on October 22, 2015

Blake - The other thought is that if you keep the tokens as text for evaluation you could just change your evaluation criteria from '10' >= '7' to '10' >= '07'.  This will evaluate correctly if both variables are strings...

replied on October 22, 2015

Blake - the other thought is that if you can force the month text token to two digit strings you can successfully compare them to month '07' instead of month '7'.  i.e. Month '01' is less than month '07' and month '10' is greater than month '07'...

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

Sign in to reply to this post.