how to auto populate (dot-walked fields in the table) variables in form

jennv
Mega Guru

hey everyone,

i have a catalog client script where i autopopulate the fields, based on some conditions. i will do for example

            g_form.setValue('notesVariable', myTableGlideRecord.notes);
but in my table i have a dot walked field and dont know what to do in this case. i tried             g_form.setValue('requestorsEmail', myTableGlideRecord.requestor.email);
 or in another case the field in my table would be company.supplier.product
How to do set field in this case? 
 
 
 
6 REPLIES 6

Sandeep Rajput
Tera Patron
Tera Patron

@jennv Instead of using a client script. You can use the Auto populate feature available on variable form in Service Catalog. For more information please refer to the blog https://www.servicenow.com/community/developer-articles/auto-populate-a-variable-based-on-a-referenc... 

 

Hope this helps.

jennv
Mega Guru

thank you very much for your answers, really appreciate it. I decided to use script include with glide ajax, as it seemed like the best approach.