- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2022 09:33 AM
Hello
We have Select Box Variable with 5 Options and Reference Type variable referencing to a Table
Suppose If Option A is selected then we want to show 5 Choices in Reference Type Variable ,How to Show Choices in Reference Type Variable based on Choice selected in Select Box
Have gone through some links but the problem is we don't have any flags in Reference table linked to Select Box Options to GlideRecord or to use reference qualifier
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2022 09:54 PM
you need to use advanced ref qualifier like this
Example: if user selects option as A then show records containing name ABC
If user selects option as B then show records containing name DEF
Ensure you give the choice value for the options.
javascript: var query; if(current.variables.variable1 == 'A') query = 'nameLIKEABC'; else if(current.variables.variable1 == 'B') query = 'nameLIKEDEF'; query;
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2022 10:16 AM
for your reference field, you'll need to create and advanced reference qualifier and add your logic to that script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2022 09:39 PM
Hello @Mike_R @Ankur Bawiskar
Any Help on the Script part ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2022 09:54 PM
you need to use advanced ref qualifier like this
Example: if user selects option as A then show records containing name ABC
If user selects option as B then show records containing name DEF
Ensure you give the choice value for the options.
javascript: var query; if(current.variables.variable1 == 'A') query = 'nameLIKEABC'; else if(current.variables.variable1 == 'B') query = 'nameLIKEDEF'; query;
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-09-2023 06:22 AM