ORDERBY not working with JavaScript Reference Qualifier in Record Producer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2025 06:12 AM
Description:
I have a Record Producer with two fields — Services and Solutions.
Both Services and Solutions are Lookup Select Box variables.
The Solutions field is dependent on the Services field, and I’ve mapped this dependency through a custom field called u_dependent_field on the referenced table.
Scenario 1: When I use a static reference qualifier (without JavaScript), for example:
u_active=true^ORDERBYu_orderthe results are displayed correctly and sorted as per the u_order field.
Scenario 2: When I use a JavaScript reference qualifier, for example:
javascript:'u_dependent_field=' + current.variables.u_services + '^ORDERBYu_order';the dependent values are retrieved correctly based on the selected service, but the results are not sorted by u_order — instead, they appear in alphabetical order.
Could you please confirm whether ORDERBY is supported in JavaScript-based reference qualifiers for Lookup Select Box variables in Record Producers, or suggest the recommended way to ensure sorting by a specific field (like u_order) when using a dynamic qualifier?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2025 07:29 AM
Hi @kiran115 ,
On the Record Producers I got the same problem,
You can just use the attribute on the Variable attributes field:
ref_ac_order_by=sequence
If you want to use the reverse:
ref_ac_order_by_desc = number
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2025 02:29 AM
Hi @Marco0o1 , I tried but not working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2025 03:01 AM
it should work fine as shared by @Brad Bowman
💡 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
10-13-2025 03:34 AM
