How to get only time field on record producer?

JMR2
Mega Expert

Dear All,

In ServiceNow form level there is a time field, how can I get time field on the record producer?
How can we do it from UI macro?
 
Please suggest.
 
Thanks
12 REPLIES 12

Hi,

on record producer Duration type of variable is available

Are you not able to get Duration?

find_real_file.png

Output:

find_real_file.png

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Hi Ankur

I just want the below type field in record produer level. 

 

on record producer time type of variable is not available right, If it is not possible suggest me with an alternative.

find_real_file.png

Hi,

that is not possible. Time type is not supported

As suggested by others you need to have UI macro variable and try what Ashutosh has mentioned

Regards
Ankur

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

Hi,

Use date time field and then fetch time from that and assign it to that time field on form as below:

var gTime = new GlideRecord(producer.variablename);

var OnlyTime = gTime.getTime();

current.FIELDONINCIDENT = OnlyTime;

 

Thanks,
Ashutosh

Hi,

Duration type is already available on record producer

If my answer solved your issue, please mark my answer as Correct & 👍Helpful based on the Impact.

Regards
Ankur

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