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

Question

Question

Add slashes to date?

asked on July 7, 2017

I have documents named by paid date.  Example "102717".   All I want to do is create a workflow that takes every document and populates the field "Paid Date" with the date specified in the name of the document.  When creating the token to pattern match the date and covert it to a standard date format "10/27/17" I'm having trouble finding the pattern that adds the slashes into the six digit date so that it's recognized as a date.  Is there a simple pattern to use that adds the slashes in?

 

0 0

Answer

SELECTED ANSWER
replied on July 7, 2017

Then your date can be represented as \d\d\d\d\d\d. You can break it down into its month, day, year components by adding parentheses in the right places:

(\d\d)\d\d\d\d would return the first 2 digits for the month

\d\d(\d\d)\d\d would be the day and so on.

Then you can reconstitute the date in the field value by adding the tokens and slashes and the lead year digits.

Note the extra slash between the first 2 tokens ("/%" is a reserved character, so it needs to be prefixed with the extra /)

1 0

Replies

replied on July 7, 2017

Patterns don't add data. They can validate a certain format and they can extract data. That said, you can do this with Pattern Matching.

A couple of questions though:

  • Is the document name just the date?
  • Is the date specified with leading zeros or without? Or both? For ex, 070717 vs 7717.
1 0
replied on July 7, 2017

All documents are 6 digit dates with leading zeros where needed.

0 0
SELECTED ANSWER
replied on July 7, 2017

Then your date can be represented as \d\d\d\d\d\d. You can break it down into its month, day, year components by adding parentheses in the right places:

(\d\d)\d\d\d\d would return the first 2 digits for the month

\d\d(\d\d)\d\d would be the day and so on.

Then you can reconstitute the date in the field value by adding the tokens and slashes and the lead year digits.

Note the extra slash between the first 2 tokens ("/%" is a reserved character, so it needs to be prefixed with the extra /)

1 0
replied on July 7, 2017

That did it.  Thank you!

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

Sign in to reply to this post.