How to sort strings that contain dates in a reference variable?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2025 01:21 AM
Hello,
I have a variable "Period" in a catalog item which is a reference variable, and displays the following values.
However, considering that these values contain dates, I would like them to be sorted based on their start date in an ascending order. So it should look like this: 10/07/2025 - 24/07/2025, 31/07/2025 - 07/08/2025, 08/09/2025 - 10/09/2025.
Even if I have an advanced ref qualifier calling a script include which sorts the values based on the start date, in the catalog item it is still sorted alphabetically (refer to the img above).
How can I disable the alphabetical sorting? Or any other ideas?
Thank you,
Smith.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2025 01:28 AM
@Smith Johnson Did you try giving order by clause in the reference qualifier field? can you share your script here
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2025 02:23 AM
Hello, thank you for your reply.
The thing is that even if i have a simple script like this with hardcoded sys_ids (for testing purposes), again it doesn't work. For example, if I have something like this in my script: returns "sys_idIN<sys_id1>,<sys_id2>,<sys_id3>"
I would expect first to show the record with sys_id1, then the record with sys_id2, and then with sys_id3. However, it doesn't work. It still shows the records alphabetically sorted.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2025 01:30 AM - edited 07-09-2025 01:31 AM
Hi @Smith Johnson
Please use the following variable attribute: ref_ac_order_by=(start_date) to sort the result in ascending order.
Please let me know if you need anything else.
Please mark the answer as correct/helpful if it helps.
Thanks,
Brahmjeet
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2025 02:23 AM
Hello, thanks for your reply. However, I don't have a start_date column. If I had, indeed this would be the solution.