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

Question

Question

Check if Current Date is Before or After a Certain Month?

asked on April 14, 2015

We have some documents that when filed in Laserfiche, need to check and see if the current date is before or after a certain month and day so it can be filed according to our school year months. How would I go about creating a token for that?

0 0

Answer

SELECTED ANSWER
replied on April 14, 2015

Where do you get the date to check against? Is it something like "if it's before April 15, this year, do..."

 

0 0
replied on April 14, 2015

Miruna, I am getting the date to check against from the name of the document when it is submitted Forms. It is the first value of the document name. Thank you for the screenshot. That helps a lot!

0 0
replied on April 14, 2015

Yeah, ok, so then this approach should work. You can use Pattern Matching to get the date out of the name. If you just need the date, then the Pattern Matching token is enough. If you need to manipulate it in some way, you can break it down into month, day, year in Date Token Calculator with token formatting.

0 0

Replies

replied on April 14, 2015 Show version history

Blake - I can think of a couple of ways to accomplish that.  One way would be to regex tokenize the month and day of the current date and then do some conditional logic in workflow, the other would be to do it in a script and return a value indicating 'before', 'after', or 'same'. 

Another option would be to download the free 'Date Tokenizer' custom workflow activity from my website and let that activity do the tokenizing for you and then just build the conditional logic into your workflow to determine which 'state' the current date is in.  (i.e. before, after, or the same as your target month/day).   The DateTokenizer activity is a free download and is available at http://www.qfiche.com/products.html

 

Screenshot of a quick workflow;

The conditional logic on the 'Before Cutoff' branch;

1 0
replied on April 14, 2015

I've got how to figure out the school year. Now to add to that, I need to be able to determine which school year folder to save the document in based on that.

I currently have tokens for the date the form was submitted, the year the form was submitted, the school year start date, next years start date, and previous years start date.

I was just going to have a conditional branch where if the date of the form was before July 1st then put it in the Previous Year-Form Year folder (ex. 2014-2015) and in the Form Year-Next Year (ex. 2015-2016) folder if it's after July first. That will not always be true though as the form could be submitted on 02/14/2015 before July 1st. Using the logic above, the folder it would go into is 2015-2016, when it should have gone into 2014-2015.

I think I'm over thinking this, but some help would be appreciated.

 

0 0
replied on April 14, 2015 Show version history

I think I figured it out. Below is a screenshot of the logic.

 

replied on April 14, 2015

I am now getting an error when trying to calculate the next year when the workflow runs. The message in Workflow for "Date Token Calculator" activity says "Input string was not in a correct format." Then another message for "Which School Year?" says "The token 'DateTokenCalculatorONext Beginning of Year' was not found [0511-WF1]". Below is a screenshot of the workflow so far:

Any ideas how to fix it?

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

Sign in to reply to this post.