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

Question

Question

Condition Bug When Using Contains Space

asked two days ago

I have a workflow with a Conditional Sequence and one of the conditions for the sequence is set to "Token: Retrieve Field Values (Invoice Number) contains 'space'" where 'space' is just me pressing the spacebar on the keyboard. When I enter it, it takes it and everything validates correctly, but when I open the workflow again it shows there is an error with the conditions of that conditional sequence. If I open the conditions, it shows the condition with a value of <empty> instead of having a space.

So, I'm guessing it should not validate correctly when I first enter a space in the value or it should and when reopening the workflow, it shouldn't show there is an issue.

This happens in both version 11 and 12.

0 0

Replies

replied two days ago

I'm going to call it a design decision rather than a bug because it's more likely that a trailing space is unintended. Though reloading and validation should behave the same way. 

You can use a regular expression in the condition instead. ("token" matches regular expression \s)

1 0
replied two days ago

I wonder if it would help if you treated it like a string - rather than just entering a space, maybe try " " instead and see if that works for you?

0 0
replied two days ago

My issue is more about it validating when I first add it and not validating when I reopen the workflow. It is not validating the same way and it should.

0 0
replied two days ago

Definitely a bug. 

We recently encountered this same scenario when attempting to set a condition to check if a token contains a space it would 'reset' to <empty> on subsequent loads of the workflow in Designer.  It would validate and publish successfully when setting the contains to a space AND more importantly it would evaluate correctly once published.  If you reopen the workflow in the designer it would perform an initial validation and fail because it resets the space to <empty> and that is invalid.  Since it executes properly I feel like this is a Designer bug that is simply trimming the value on reload but the actual published workflow is fine.  

An alternate solution which seemed to work is to create a token (eg. spaceToken) and set the value to a space.  Then your condition would be 'contains' against this token.  That appears to work in my testing.  Potentially you could also try a condition of 'matches regular expression' where the expression would be
.*([ ]).*

In between the hard brackets is a space.  This should evaluate to TRUE in the event that a literal space exists in the token being matched.  I like my first solution better as its easier to understand when reviewing the workflow in the future.

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

Sign in to reply to this post.