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  Hi! 

If user observed fields are created in date or date/time field type in the import set table, change data formatting in the Excel file first. This will make sure all the fields will be created in String field type in import set table.
For example, copy the original cell values out and change the cell formatting to 'Text' and copy back the values into the cell again.

Note 1: Once the field is created in date/time type in the import set table, the field type can not even be changed to String in table dictionary as there is no String option. User needs to drop the import set table, change the data formatting in Excel and import it again. Please refer to below screenshot (1) attached.

Note 2: If the field is created in date type in the import set table, the field type can be manually changed to String type. However, user still needs to change the data format in the Excel file to avoid the same issue happens again.

 

Note 3: Always make sure correct date format is being selected in the field mapping. The format should be consistent with the imported date or date/time values in the import set table.

 

Please mark it helpful if it helps

@SoniaShridhar13 I asked if the system knows how to read this format 04-AUG-2022? if yes how it should be written in the transform map format

You can do this via a Field Map Source script.   Use the Javascript substring() function to get the pieces of the date to a string that you can then set to a date.

Sonu Parab
Mega Sage
Mega Sage

Hi @Alon Grod , Have a look at this post Date format transform maps 

If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!
Thank you