get user preference date format

Akki1
Tera Contributor

Hi,

I want to get user preference date format and I have a form field called modified which is concat of u_last_update & u_updated_by. These two fields are not being displayed on the form I want to get user preference format and set it accordingly and use it on modified . Can I use onLoad script and use it? But how exactly I get the format

10 REPLIES 10

Ankur Bawiskar
Tera Patron

@Akki1 

what type of fields are those?

why not use server side script i.e. BR and set the value? anyhow that field is not on form then you can use business rule

what script did you start with and where are you stuck?

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

@Ankur Bawiskar The 'last_update' is date field and the Update by is string . And the Modified is string field which is concact of these both. Initially I was using function field to concat but the date format of last_update was not coming to according to user preference date foemat but it was every time coming the same format.

@Akki1 

share that script

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

@Ankur Bawiskar 

for function field in function definition I have written

glidefunction:concat(u_last_update,'-',u_updated_by)