- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2019 09:45 AM
Hello - we are using a multirow variable set in one of our catalog items (contains 6 variables). When the catalog item is submitted through the Service Portal, a lot of the data that was entered in the MRVS is missing when viewed in the platform. When the same catalog item is submitted through the platform with the same data in the MRVS, all data is retained.
I haven't seen anything in the community describing this issue, and the closest thing I found in HI is not exactly the same (https://hi.service-now.com/kb_view.do?sysparm_article=KB0713584). This seems to be a Service Portal issue. Has anyone experienced this or able to provide some insight? Thanks in advance!
Solved! Go to Solution.
- Labels:
-
Request Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2019 07:41 AM
After you posted the code of OnChange script I could reproduce the problem and I can suggest a workaround.
The main problem in your code exist in the line
g_form.setValue('u_ukbilling_total_inc_vat', total, total);
where total variable is a Number. As the result the value of multirow variable set uk_billing_invoice_details_new will be JSON string like
[{
"uk_billing_total_inc_tax": 1,
"uk_billing_sales_order_number": "b",
"uk_billing_net_amount": "1",
"uk_billing_invoice_number": "a",
"uk_billing_tax_rate": "3"
}]
where the value of u_ukbilling_total_inc_vat variable is a number instead of a string. It's unclear why exactly, but it produce some problem in later processing of the data.
To fix the problem you can use for example the following code
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
var netamount = g_form.getValue('net_amount');
var vatrate = g_form.getValue('tax_rate');
var vattotal = parseInt((vatrate/100) * netamount, 10);
var total = parseInt(netamount, 10) + parseInt(vattotal, 10);
g_form.setValue('total_inc_tax', String(total));
}
where one sets string value. After the changes the problem was fixed in my test environment.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2019 01:16 PM
Are you using the out-of-the-box SP Catalog Item widget on the Service Portal or a custom one? Asking this because the MRVS was introduced in London, and the SP Catalog Item widget got updated. If you are using a custom one, it's not automatically updated of course and might not support the MRVS.
Kind regards,
Mark
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2019 05:58 AM
Hello Mark, to answer your question, I am using the OOB catalog item widget. I figured out that the problem is caused by an on-change client script I'm using in my MRVS. When this script is disabled, everything works correctly -- all data is captured. But I'm not sure what it is about the script that is problematic since the script causes no issues when used through the platform UI. Here's the script in case anything sticks out to you:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
var netamount = g_form.getValue('u_ukbilling_net_amount');
var vatrate = g_form.getValue('u_ukbilling_vat_rate');
var vattotal = parseInt(((vatrate/100) * netamount));
var total = parseInt(netamount) + parseInt(vattotal);
g_form.setValue('u_ukbilling_total_inc_vat', total, total);
}
Thanks for your time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2019 04:23 AM
It sounds like a bug in some widget of Service Portal. Could you describe the problem step by step (including the definition of MRVS and the test data for MRVS entered in Service Portal), so that I could reproduce the problem and could debug the widgets?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2019 12:36 PM
Hello Olegki, sure here are the details:
The MRVS is called "Invoice Details", and contains 5 single line text variables. Invoice Details is part of a catalog item that contains 3 other "regular" (single row) variable sets. There are also 4 stand-alone variables in this catalog item. Associated with this MRVS is one client script and one UI policy. If you need more information on these, please let me know.
Attached are some screenshots -- hopefully this helps. Thanks in advance for any help you can provide.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2019 02:31 PM
Sorry, but I can't reproduce the problem. I created MRVS "Invoice Details" with close 5 single line text variables and added the variable set to an existing catalog item (I used "Standard Laptop" for my test). After that I produced an oder in the platform and another one in Service Portal. Both requests had two rows of "Invoice Details". The requests contain correct "Invoice Details" in both cases. I used personal developer instance with Madrid version of ServiceNow.
It could be that there are more details in the multirow variable set or catalog item, which you use. Which version of ServiceNow has your instance? Do you use original widgets of Service Portal of you use some clones made in previous version?