- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2019 02:25 AM
Hi,
I want to see i3 as cpu selected and "total estimation cost is 300" in total_estimated_cost column if i select the choice as i3 in CPU field.
I want to use onChange client script to do this.
Here i have made:
Record producer: Estimation RP
Mutli row variable set: Disc size
pls help
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2019 02:43 AM
Hi there,
Not quite understand your requirement of why to do this. Though it is possible to onLoad and also onChange outside the MRVS, to fill rows in the MRVS.
Look at example script below. Obviously, you have to change the variable names, mrvs name. Maybe you also have to do something with labels/values. Though basic script works (= tested).
function onChange(control, oldValue, newValue, isLoading) {
if(isLoading || newValue == '') {
return;
}
var rowObj = [];
rowObj.push(
{
"actions": "",
"mrvs_variable_1": g_form.getValue('name_of_variable_you_are_trying_push')
}
);
g_form.setValue('name_of_your_mrvs', JSON.stringify(rowObj));
}
If my answer helped you in any way, please then mark it as helpful.
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
07-10-2019 02:43 AM
Hi there,
Not quite understand your requirement of why to do this. Though it is possible to onLoad and also onChange outside the MRVS, to fill rows in the MRVS.
Look at example script below. Obviously, you have to change the variable names, mrvs name. Maybe you also have to do something with labels/values. Though basic script works (= tested).
function onChange(control, oldValue, newValue, isLoading) {
if(isLoading || newValue == '') {
return;
}
var rowObj = [];
rowObj.push(
{
"actions": "",
"mrvs_variable_1": g_form.getValue('name_of_variable_you_are_trying_push')
}
);
g_form.setValue('name_of_your_mrvs', JSON.stringify(rowObj));
}
If my answer helped you in any way, please then mark it as helpful.
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
07-16-2019 02:30 AM
Hi Mark,
This script is not working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2019 12:41 PM
Hi Mark,
Can you please let me know how can i get a value and populate the value dynamically by using on-change script.
per Example in the below image : If Number is 123 the Cart should display yes.
Thanks,
Mahesh R

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2019 12:46 PM
Hi there,
How is number generated in your example? Automatically, onLoad, onChange of a variable outside of the MRVS, manual?
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field