Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Question on how to format Contract Date format

Aaron Duncan
Mega Sage

I am working on a Contract template, and the request is to have the date format come across as examples of June 20, 2025 or June the 20th, 2025. 

I have the Template mapping field for the Contract Start Date from the catalog item, but no matter what I try, I cannot seem to get it formatted correctly.

 

 

AaronDuncan_0-1735847921961.png

 

1 ACCEPTED SOLUTION

@Ankur Bawiskar you put me on the right track, I modified it slightly to meet the requirements. Thank you!

 

	var gd = new GlideDate(); 
	gd.setValue(taskGr.variables.start_date); 
	return gd.getByFormat("MMMM dd, YYYY").toString();   

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@Aaron Duncan

you can use script option

var gd = new GlideDate(); 
gd.setValue(mappingFied);
return gd.getByFormat("MMM dd, YYYY");

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar you put me on the right track, I modified it slightly to meet the requirements. Thank you!

 

	var gd = new GlideDate(); 
	gd.setValue(taskGr.variables.start_date); 
	return gd.getByFormat("MMMM dd, YYYY").toString();   

@Aaron Duncan 

Glad to know.

Please mark my response as correct as I provided you the solution or provided the correct guidance.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader