How to add reference qualifier in catlog item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I have a catlog item having 2 variables as list collectors referred to same table. One is existing accounts another one is remove account. Existing accounts is auto populate based one field change but now i want to visible only existing accounts in my remove account.
Example existing accounts I have tcs, Infosys,tech M
Only that record needs to visible in remove account as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hey @sivamanich1
You can achieve this using a Reference Qualifier on the Remove Account list collector.
Scenario:
Existing Accounts is auto-populated
Remove Account should display only the accounts selected in Existing Accounts
Example:
Existing Accounts:
TCS, Infosys, Tech M
Then Remove Account should only show:
TCS, Infosys, Tech M
Solution
Add the following Reference Qualifier on the Remove Account variable:
javascript:'sys_idIN' + current.variables.existing_accountsReplace:
existing_accounts
with your actual variable name.
How it works:
- List Collector stores selected record sys_ids
- sys_idIN filters the available records
- Only records selected in Existing Accounts will appear in Remove Account
Additional Recommendation
If Existing Accounts changes dynamically, add an onChange Catalog Client Script to refresh the slushbucket:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading)
return;
g_form.setValue('remove_account', '');
g_form.refreshSlushbucket('remove_account');
}This ensures the Remove Account list updates immediately after changes in Existing Accounts.
*************************************************************************************************************************************
If this response helps, please mark it as Accept as Solution and Helpful.
Doing so helps others in the community and encourages me to keep contributing.
Regards
Vaishali Singh
Servicenow Developer
Linkedin - https://www.linkedin.com/in/vaishali-singh-2273361bb
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hey @sivamanich1
Hope you are doing well.
Did my previous reply answer your question?
If it was helpful, please mark it as correct ā and close the thread . This will help other readers find the solution more easily.
Thankyou & Regards
Vaishali Singh
Servicenow Developer
Linkedin - https://www.linkedin.com/in/vaishali-singh-2273361bb
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hi @sivamanich1
- Assumption, there are 2 list collector variables
- existing_accounts: List Collector (e.g., Variable existing_accounts)
- remove_account: List Collector (e.g., Variable remove_account)
- Configure "Remove Account" Variable:
- Go to the "Remove Account" variable definition.
- Under Type Specifications, set Use reference qualifier to Advanced.
- In the Reference qual field, enter:
javascript:'sys_idIN' + current.variables.existing_accounts
- Create Catalog Client Script:
- Name: Filter Remove Account List
- Type: onChange
- Variable Name: existing_accounts
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading) {
return;
}
if (newValue === '') {
g_form.setValue('remove_account', '');
return;
}
g_form.refreshSlushbucket('remove_account');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
so please share screenshots and what you tried
without this we can't help
Ankur
⨠Certified Technical Architect || ⨠10x ServiceNow MVP || ⨠ServiceNow Community Leader