Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

display formatted date stamp using [now]

Andrey Pykhantsev December 11, 2018

Hi, I'm trying to display the time a form was modified/approved to create a unique approval number formatted as: XX–YYYYMMDD, where XX are the initials of the person approving.

 

I got this to work chaining several methods below:

 

[entry.name.upperCase.trunc(2)]-[entry.created.formatDate(yyyyMMddHHmm)].

 

However, this only works with the time when the form was created. I tried using [now] and FORMATDATE(NOW()) as decribed in this article, and the result is a random number like '1544543232619'.

Tried several ways of getting [now] to work but no luck. Screen Shot 2018-12-11 at 11.32.24 AM.png

2 answers

0 votes
Andrey Pykhantsev December 19, 2018

after trying to get formatDateAs() and now() to work, got a way around it by 

1. creating a separate field date that stores the epoch time

2. using two separate IFTTT macros to first assign current time to date and later to use that field value to format it using 

[entry.name.upperCase.trunc(2)]-[entry.time.formatDate(yyyyMMdd)]

 

Screen Shot 2018-12-19 at 12.01.11 PM.png

Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 10, 2019

Each ConfiForms field has a "created" field, which is set with the value on record creation - you can use that field. Also, you can always use [entry._now] or just _now to access the current time

And you can apply any of the virtual function on these fields, as usual

0 votes
Diego
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 12, 2018

Hello there Andrey!
As far as I understand the documentation provided by the Confiform team, the approach to this would be to use the FORMATDATEAS function:

[entry.name.upperCase.trunc(2)]-[entry.created.FORMATDATEAS(now(),"yyyyMMddHHmm")]

The pattern used is correct, according to this Oracle documentation:

Oracle - Simple Date Format 

The number that you end up with is in EPOCH format, used by Unix. For example, 1544543232619 corresponds to Tuesday, December 11, 2018 3:47:12.619 PM.

Let us know if the FORMATDATEAS function works as expected!

Andrey Pykhantsev December 12, 2018

It works the same way as the functions I tried, namely output is in EPOCH format, not "yyyyMMddHHmm". 

Seems that it only does it when I'm trying to get the current timestamp using

 

[now]

or

 now()

 

P.S.: the form should grab the moment the form is approved, not the time it was created. I'm using IFTTT macro with onModified event and setting this parameter on the entry field. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events