My date variable is not pulling in correct format

Roberta B
Mega Guru

Hello -

 

In my Onboarding catalog item, I have a start_date variable that is auto-populated from an email from Workday.

That start_date variable field value appears as mm/dd/yyyy (shown here):

RobertaB_2-1699392367761.png

 

I have a script in the workflow (Workflow Editor) for each Catalog Task that generates, and appends the new hire's name from the New Hire's Name variable field to the end of the Short Desc (which is working as shown here):  

RobertaB_1-1699392191698.png


I now want to append the start date from the start_date variable field, at the end of the Short Desc; however, the date is showing as yyyy-mm-dd and I'm not sure why (shown here):

RobertaB_3-1699392387024.png

 

 

This is what the script was:
task.short_description = "Onboarding - Equipment Request - "+current.variables.new_hires_name;

 

This is what I changed the script to:
task.short_description = "Onboarding - Equipment Request - "+current.variables.new_hires_name+" - "+current.variables.start_date;

 

 

NOTE:
I did check the 'glide.sys.date_format' system property and it is Active and Value = MM/dd/yyyy

 

Any guidance would be much appreciated.

1 ACCEPTED SOLUTION

Brad Bowman
Kilo Patron
Kilo Patron

Hi Roberta,

 

The value of a date field (current.date_field_name) will always be the system format of yyyy-mm-dd as you have discovered.  To get the date display format try current.date_field_name.getDisplayValue()

View solution in original post

5 REPLIES 5

Appreciate the suggestion @Sandeep Rajput!   I used Brad's suggestion, as it was a simpler solution, and it worked.