- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2025 10:24 AM - edited ‎01-29-2025 02:25 AM
Hi Community...
I got a requirement that, based on the inside variable value in MRVS, i need to hide the entire container,
For example, Iam having A,B,C,D variables in the MRVS container. Based on the input variable value we need to display the data in B,C and D. (here "A" is reference variable, BCD are text variables)
suppose if the value of A='empty or 'null', no need to display the other variables and also the MTVS container need to hide on the form. (entire container need to hide).
If "E" is external variable (outside the container) means, based on that we can hide the MRVS container, But this variable "A" is inside the MRVS container.
I have tried with the catalog UI polocy and catalog client script, but no luck.
Please help any one, how can i achive/implement this fucntionality please suggest.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2025 07:17 AM
@Ankur Bawiskar Hi ANkur, I have seen your other thread reply in the community regarding the same scenario.
https://www.servicenow.com/community/developer-forum/hide-variable-column-from-multi-row-variable-on...
DOM manipulation suggested by you. Is it good to implement this or not ?
Please let me know
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2025 03:02 AM
your onLoad catalog client script should be Applies on Requested Item and Applies to Catalog Item
Check if the MRVS itself is empty or not and hide if empty
function onLoad() {
var rritm = g_form.getValue('previous_ritm_s');
if (rritm == '') {
g_form.setDisplay('previous_ritm_s', false);
}
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2025 03:30 AM
@Ankur Bawiskar Hi Ankur,
after applying your code also MRVS container is not hiding, just empty container showing like below.
Output:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2025 03:35 AM
this will work
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2025 03:46 AM
@Ankur Bawiskar No Ankur, still the empty MRVS container is showing, its not hiding with your script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2025 03:51 AM
it worked for me and removed the MRVS if empty on RITM form
Are you sure you gave the correct variable set name for MRVS?
See output
Share your script and configuration
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader