- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-15-2021 02:54 AM
Hi All,
Hope everyone is doing good.
I am working on a catalog form with Variables,
Name (reference to User table), Department, Work Location, Telephone, Email. When value changes in Name variable, all the other variables get populated automatically if the user in Name variable has that values exist. If not, we are allowing users to manually enter values in Department, work location, telephone, email variables.
We have a MRVS with the same variables as mentioned above.
Now, We have a checkbox variable on the same form with name "Self". When user checks it to true, all the values in the Name, Department, work location, telephone, email should be copied to variables in MRVS. If he unchecks, the values should get cleared (only the row should get deleted which is populated when the variable is checked). This should work on change of both Name and Self variables.
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-21-2021 06:17 AM
Done and working fine in native
please check below output
Please mark my response as correct and close the question.
Regards
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-15-2021 03:06 AM
Hi,
you can write onChange client script on Name and Other variable
1) then set MRVS with the array of JSON string values
2) to clear MRVS use g_form.setValue('mrvsVariableName', '');
Regards
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-15-2021 03:11 AM
Hi
Thank you.
1. Is it possible to clear specific row in MRVS which is populated because of checking Self to true.
2. Do I need to write two OnChange client scripts? for each variable. Could you please provide rough script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-15-2021 03:18 AM
Hi,
1) yes specific row can be removed
a) iterate the array of json objects and if value found then don't push that in new array of json objects
2) check links for point 2 where I have shared solution; enhance it as per your need
How to set MVRS variable value to a variable of catalog item onSubmit/OnChange
How to populate values in MRVS automatically from List type variable on catalog item
Regards
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-15-2021 03:52 AM
Hi
As all the variables on the catalog form itself, like Department, Work location, email, telephone, instead of using script include how to get these values and convert to json and push it into MRVS. And this script should work only when Self check box is set to true.
Thank you.