how to query a table in client script in servicenow.

Community Alums
Not applicable

Based on requested for how to populate the values such as (city, country code, employee number, gender, street, zip code) from the custom table (u_uc_divya) to the service catalog.

 

PRITHVIRAMESH_1-1684429256943.pngPRITHVIRAMESH_2-1684429278028.png

 

 

16 REPLIES 16

Community Alums
Not applicable

PRITHVIRAMESH_0-1684441140306.png

 

Community Alums
Not applicable

and this is the custom table form where i want to populate the values in the catalog item.

 

PRITHVIRAMESH_1-1684441228822.png

 

Can you configure the table and show me the table field names?


Please mark this response as correct and/or helpful if it assisted you with your question.
Steven

Community Alums
Not applicable

u_city, u_country_code, u_employee_number, u_gender, u_street, u_zip_postal_code these are the field values and below mentioned is the code which i tried to run.

 

function onLoad() {
var data = g_form.getReference('requested_for',myData);

function myData(data){
g_form.setValue('city',data.u_city);
	alert('city');
g_form.setValue('country_code',data.u_country_code);
g_form.setValue('employee_number',data.u_employee_number);
g_form.setValue('gender',data.u_gender);
g_form.setValue('street',data.u_street);
g_form.setValue('zip_postal_code',data.u_zip_postal_code);

 }
}

custom table? so you're not getting the city/zip/etc. from the sys_user table?