- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago - last edited 3 hours ago
How Can I Order the Variable Name Choices within a Catalog Item Reference Qualifier Javascript
Dear ServiceNow Community Colleagues,
I am using a Lookup Select Box variable, on my catalog item, due to having variables that are dependent on another (Select Box) variable.
In this case, the Lookup Select Box variable is 'Functional Area' and it has a dependency on a Select Box variable, called 'Platform/Account'.
I have attached full screenshots for guidance, including my existing Reference Qualifier javascript, that creates the dependency.
My question is: what would be the adjusted Javascript to use, so as to OrderBy (show in alphabetical order) the 'platform_account' names that are presented on Service Portal, using this Lookup Select Box variable.
Please could I request advice/guidance on what is the adjusted Javascript I need to use within Reference Qualifier, to OrderBy 'platform_account' (which is the main Select Box variable).
All screenshots are attached, showing my existing configuration.
Many thanks for any help on achieving this.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
try this
give the field name based on which you want to order by
javascript: 'ORDERBYfieldName' + 'u_platform_account=' + current.variables.platform_account
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago - last edited 3 hours ago
Hi @WazzaJC
in variable attributes: ref_ac_order_by=<FieldName>
OR
in reference qualifier add= javascript: ORDERBY<FieldName>'
note: replace <FieldName> with correct field value from the referenced table on which sort needs to be added.
If it is not working in portal, try with variable attribute -
ref_sequence=<Field Name>
Ref: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0535733
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi @Tanushree Maiti , so how does the complete, updated Javascript look, including your suggested update? This is the current Javascript - what would be the full, correct Javascript I need to use based on your suggestion? Thanks
javascript: 'u_platform_account='+current.variables.platform_account
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi @WazzaJC : first try with Variable attribute option.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi @Tanushree Maiti it doesn't work - I tried that option already.
