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

Question

Question

Extracting Year from Date Token in Forms

asked on December 27, 2013

In Workflow I can take today's date, and then apply formatting to just get the current year. Can I do this with the start date token in Forms as part of a Save to Laserfiche activity?

 

3 0

Answer

APPROVED ANSWER SELECTED ANSWER
replied on December 27, 2013

At this point, there's not any formatting you can apply to variables. The value they reference is the value that you'll get, so if you want the value to be formatted a different way your best bet is to change that value before it is stored in a variable.

 

For example, let's say you have a form field that you populate with the start date variable. You could use JavaScript to grab only the year from that value and place it in another field. Then, if you wanted, you could reference the new field's variable instead of the start date variable.

3 0

Replies

replied on December 27, 2013

Indeed, I've been using a lot of hidden fields to do magic like that. Thanks.

0 0
replied on December 27, 2013

If you have use cases for particular operations you'd like to be available for variables, feel free to post them and I'll bring them up with the team. It's possible that we'll add functionality like this in a future release.

2 0
replied on December 1, 2015

I found this thread because i'm looking for a way to use the start date year of the form as part of the Save to Repository folder path, much like I do in workflow all the time. I'll build a hidden field for this for now.

0 0
replied on December 1, 2015

While not all the way there yet, the new formula functionality in Forms 10 will make it easier to get the year from a date value and use that in another field so you don't have to use any JS for it. If your date field has a variable named "Date" then you can use a formula like

=YEAR(Date)

in the hidden field.

2 0
replied on September 13, 2016

On this same topic of getting Year, Month, Day from the Date field.  How would I go about getting the Month and Day but with two decimal places.

Date fields is 9/13/2016, defaulting to todays date.

=MONTH(Date)        gives me "9" but I want "09"

=DAY(Date)       gives me "13"  but if the day is lower than 10 it does the same as above.

Any suggestions?

0 0
replied on September 13, 2016

Also if I do:

=DATE(YEAR(Date),MONTH(Date),DAY(Date))   I get "42626"  How can I make this a readable date?

0 0
replied on November 4, 2021

I was able to get a usable MM date using =IF(MONTH(DATE)>9,MONTH(DATE),CONCATENATE("0",MONTH(DATE))) in a hidden Month field. The same can be done for Day().

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

Sign in to reply to this post.