sysID showing in catalog item

Erik Stuer
Tera Guru

I am building a custom catalog item for a request. I built a couple of custom tables to load historical data from the client. I have a MRVS for one of these tables that uses reference type variables. It is linking to my custom table (ie it shows the field name correctly when populating the differently variables w/i the mRVS) BUT it populates the sysID not the field value when add the variables to the MRVS. I tested this process with another MRVS that has two variables (the sys_user and sys_user_group tables) and that correctly populated the field name. I am assuming my reference qualifier or the custom table configuration is the issue. Any help would be greatly appreciated. 

1 ACCEPTED SOLUTION

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

Have you checked that the displayValue for the custom table is set? If not, it will indeed show the sys_id.

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

View solution in original post

3 REPLIES 3

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

Have you checked that the displayValue for the custom table is set? If not, it will indeed show the sys_id.

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Thank you. That was the issue! I am new to custom tables. Thank you for the quick response!

Another issue I am running into is populating a variable within my MRVS. I have two fields from my custom table that are referenced in 2 of my variables within my MRVS. When the user fills out the first variable, I want the second variable to populate with its value. I am trying with a catalog client script (below) but no luck. Any suggestions?

 

function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}

// This code runs when the 'Product Name' variable changes
// Get the value of the 'Product Name' variable
var productName = g_form.getValue('product_name_variable'); // Replace 'product_name_variable' with the actual name of the 'Product Name' variable

if (productName) {
// Query the 'Product List' table to get the 'Item Number' field
var productGR = new GlideRecord('product_list'); // Replace 'product_list' with the actual table name
productGR.addQuery('name', productName); // Replace 'name' with the actual field name for 'Product Name'

if (productGR.next()) {
// Update the 'Item Number' variable with the 'item_number' field value
g_form.setValue('item_number_variable', productGR.getValue('item_number')); // Replace 'item_number_variable' with the actual name of the 'Item Number' variable
}
}
}