The CreatorCon Call for Content is officially open! Get started here.

Format of Date field in transform map

Alon Grod
Tera Expert

Hi,

 

In my xlsx file the Date filed is written: 04-AUG-2022

Is there any way to change the date format in the transform map so it will know how to get this format from the xlsx file?

 

Screen Shot 2023-01-30 at 12.01.09.png

1 ACCEPTED SOLUTION

Hi @Alon Grod ,

No we don't have that  date format in ServiceNow. ServiceNow date fields will not take if you pass 04-AUG-2022 like this.

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

View solution in original post

18 REPLIES 18

SoniaShridhar13
Giga Guru

@Alon Grod  

Try

 

(function executeRule(current, previous /null when async/) {

 

var gd = new GlideDate();

 

current.'your fieldname' = gd.getByFormat('YYYY-MM-DD');

 

})(current, previous);

@SoniaShridhar13 i need DD-MMM-YYYY

var gdt = new GlideDate(source.your_date_field); var dt = gdt.getByFormat("dd/MM/yyyy"); return dt;

it will return in the system 04-AUG-2022? @SoniaShridhar13 

Yes