We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Autopopulate Contact field when the Account is selected.

Not applicable

My code wont work or i missing something? please need help. 

Contact is reference field

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   if (isLoading || newValue === '') {
      return;
   }
var selectedAccount = g_form.getValue('account');

if (selectedAccount == 'Microsoft' ){

	g_form.setValue('contact', 'Microsoft Service Desk');

}

   //Type appropriate comment here, and begin script below
   
}

 

11 REPLIES 11

Not applicable

Please share screenshot of your script and form.

Not applicable

Hello @Community Alums 

I already configured the problem thanks for support.