How to sort in the specified order by addQuery()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2022 10:51 PM
The retrieved data is sorted in the order of the field status 05 02 01
thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2022 11:09 PM
Hi,
what do you mean by sorting with field status?
Are these the choice values 5,2, 1
Share your script and share some screenshot
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2022 11:14 PM
That is to say, the retrieved data has three states of 05 01 02. I want to make 05 at the top and 01 and 02 at the bottom. Can addquery be implemented? Is there any other way to implement it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2022 11:25 PM
Hi,
are those the choice values of some field?
Anyhow which sorting is this 05 -> 01 -> 02?
It's not even ascending or descending
You can use orderBy() -> for ascending
orderByDesc() -> for descending
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
