- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 12:38 AM
I have created a catalog item with some variables and i want to display same variables value records in related list and al Acceptance criteria:
i know this is done by using relation ships, and add it to related lists,
I have done that already
But i want to display when a variable (select box )value is in individual , other wise no records in related list
This is the condition i have return in the relationships:
here i have used Specifiy staff variable sysid
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 12:47 AM
so are you saying if that RITM has variable as Individual in it then only it should come in related list
if variable value is not Individual then that RITM should not show in related list although other variable matches?
If yes then use this
var variableSysId = '5bdf1779833bda5091c71c29feaad3aa';
var variableSysId1 = ''; // give here the sysId of the Award Category variable
current.addQuery('variables.' + variableSysId, parent.variables[variableSysId]);
current.addQuery('sys_id', '!=' ,parent.sys_id);
current.addQuery('variables.' + variableSysId1 , "!=', 'Individual'); // give here the choice value from select box
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
03-04-2025 12:52 AM
are you saying if the current RITM form has Award Category Variable as Individual then only show that related list or else hide?
if yes then you can use normal onLoad client script and get the variable value and hide it
function onLoad() {
// give correct variable name and choice value
if (g_form.getValue('variables.awardVariableName') != 'Individual')
g_form.hideRelatedList('REL:e1c005f91b0c2a508e08fc451a4bcbd2'); // to get the name use Right Click on list and configure List control and pick the name
}
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
03-04-2025 12:47 AM
so are you saying if that RITM has variable as Individual in it then only it should come in related list
if variable value is not Individual then that RITM should not show in related list although other variable matches?
If yes then use this
var variableSysId = '5bdf1779833bda5091c71c29feaad3aa';
var variableSysId1 = ''; // give here the sysId of the Award Category variable
current.addQuery('variables.' + variableSysId, parent.variables[variableSysId]);
current.addQuery('sys_id', '!=' ,parent.sys_id);
current.addQuery('variables.' + variableSysId1 , "!=', 'Individual'); // give here the choice value from select box
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
03-04-2025 12:52 AM
are you saying if the current RITM form has Award Category Variable as Individual then only show that related list or else hide?
if yes then you can use normal onLoad client script and get the variable value and hide it
function onLoad() {
// give correct variable name and choice value
if (g_form.getValue('variables.awardVariableName') != 'Individual')
g_form.hideRelatedList('REL:e1c005f91b0c2a508e08fc451a4bcbd2'); // to get the name use Right Click on list and configure List control and pick the name
}
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
03-04-2025 01:08 AM
yes Ankur But the first one is also fine, records are not displaying if award category is not individual