How to check assigned to field value is not null in client script.

varma2
Mega Sage

Hi All,

Please suggest How to check assigned to field value is not null in client script.

 

Thanks&Regards,

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can simply check if value is present or not like this

if(g_form.getValue('assigned_to')){

// value present

}

else{

// value is empty or null

}

Regards
Ankur

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

View solution in original post

4 REPLIES 4

Elijah Aromola
Mega Sage

You can try the following:

var assigned_to = g_form.getValue('assigned_to');
if(assigned_to != "" && assigned_to != undefined) {

}

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can simply check if value is present or not like this

if(g_form.getValue('assigned_to')){

// value present

}

else{

// value is empty or null

}

Regards
Ankur

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

Ankur Bawiskar
Tera Patron
Tera Patron

@varma

Hope you are doing good.

Let me know if I have answered your question.

If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.

Regards
Ankur

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

sunanda
Tera Contributor

Hi All,

 

How to check assigned to field value is not empty in server side script