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.

How to clear Dynamic Default value on dictionary with Client Script

mballinger
Mega Guru

Hello,

I have a dictionary that is time stamped to today using the Dynamic Default on the field. How can I override this value with a client script? I tried the following:

function onLoad() {
   g_form.clearValue('u_date');
}

This did not work.

Thanks!

1 ACCEPTED SOLUTION

It seems onLoad() is getting executing before the values are populated using Default.

Can you confirm the exact business need once.

View solution in original post

3 REPLIES 3

Jaspal Singh
Mega Patron
Mega Patron

Try below.

function onLoad() {
   g_form.setValue('u_date','');
}

@Jaspal Singh - Thanks for your response!

I tried this as well and it did not clear.

The field is using a Dynamic Default Value. I am not sure if this makes a difference

It seems onLoad() is getting executing before the values are populated using Default.

Can you confirm the exact business need once.