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

Question

Question

Workflow padding 0 to date value

asked on February 18, 2015 Show version history

Hi there,

I was trying to pad a 0 to a date value when retrieving the field. This is a snippet of the workflow below:

The problem is with the condition I attempted to put in the token value less than 10. The problem with this is that it would not recognize it as a number value for the token. It would recognize it as a character so I had to list a condition for each number 0-9. Is this a known issue or is there a way to modify the token to be recognized as a int?

I would like to do this:

instead of this:

0 0

Answer

SELECTED ANSWER
replied on February 18, 2015 Show version history

In your conditions, you're using the token from the pattern matching activity which would be a string. After pattern matching, use an "Assign Token Values" activity to assign the pattern matching token to a new token and use token tags to set the new token as an integer. Then in the condition editor, use the new token.

1 0

Replies

replied on February 18, 2015

Rather than padding the date like that, you can use the original date token and then apply formatting.  To get a 2 digit month, use format = MM.  To get a 2 digit day, use format = dd.

 

2 0
replied on February 18, 2015

How are you padding your dates? If you need them all to be in the same format, then you can use "Apply Formatting" in the token dialog and enforce the format "MM/dd/yyyy". With this any single digit will be automatically padded, and you won't need to have multiple branches or conditionals.

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

Sign in to reply to this post.