The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Show String data on Date field

Developer2764
Tera Contributor

Hi Team,
Good Day!
there are two variables. One is Single line text and other is date type. First variable will take dates but in Jan 1, 2023 format. I want to capture this date in second variable. it's name is capture date[c_date].
Thanks

7 REPLIES 7

Sagar Pagar
Tera Patron

Hello,

I would suggest to allow users to select the date in date type variable only. It will not cause issue in future.

 

If my response helps to solve your issue. Kindly mark it as helpful & correct. It will be helpful for future readers.
Thanks,
Sagar Pagar

The world works with ServiceNow

Hi @Sagar Pagar, i want to show date in "March 2, 2022" format. but date field is not showing. So, i make a logic as alternate.

Hello @Developer2764 

 

 

var date = g_form.getValue('first_date_field');
var newDate = date.getByFormat("MMMM dd, YYYY");
g_form.setValue('second_date_field', newDate);

 

 

use this script for ur requirement.

 

Plz Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.

 

Regards,

Samaksh

Hi @Samaksh Wani, is it possible that after autopopulating from date to single line text, date should be show as December 11, 2022. instead of 12-11-2022 on single line text