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.

else staement

Bob44t
Tera Contributor

Good morning how can I make the else statement edit existing group routings?

1 ACCEPTED SOLUTION

Kalyani Jangam1
Mega Sage

Hi @Bob44t 

Try below code

var grp=new GlideRecord("u_group_routing")
grp.addQuery('sys_id',recordToEdit);
grp.query();
if(grp.next()){
grp.field_name='';
grp.update();

}

Please mark helpful and correct if it really helps you

View solution in original post

1 REPLY 1

Kalyani Jangam1
Mega Sage

Hi @Bob44t 

Try below code

var grp=new GlideRecord("u_group_routing")
grp.addQuery('sys_id',recordToEdit);
grp.query();
if(grp.next()){
grp.field_name='';
grp.update();

}

Please mark helpful and correct if it really helps you