how to query a table in client script in servicenow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2023 10:02 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2023 01:19 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2023 01:20 PM
and this is the custom table form where i want to populate the values in the catalog item.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2023 01:38 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2023 10:44 PM
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);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2023 01:40 PM
custom table? so you're not getting the city/zip/etc. from the sys_user table?