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?
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?
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.
Indeed, I've been using a lot of hidden fields to do magic like that. Thanks.
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.
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.
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.
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?
Also if I do:
=DATE(YEAR(Date),MONTH(Date),DAY(Date)) I get "42626" How can I make this a readable date?
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().