Skip to main content
Question

Formula Query Sorting

  • October 29, 2021
  • 0 replies
  • 552 views

Does slist and option=sortorder work within formula queries?

In my formula query my items return the correct values but the sort does not work. Also does num-# work with the amount of records you want returned.

var text Query ="{27.EX." & [Order Type] & "} &slist=3&options=sortorder-D";

------------------------------
Tyrone Grey
------------------------------
This topic has been closed for replies.

RaziD
Forum|alt.badge.img+3
  • Quickbase Alumni
  • October 29, 2021
Hi Tyrone;
I don't think this would work.
In your "Query" you don't have only query you have also sorting and sorting option
GetRecords formula doesn't accept sorting parameters yet; if I know it correctly

For the number of records you can use "Count" function. I wanted to see number of records so I have created a numeric formula field in my application to capture that.
it is something like this:
Count(ToText(GetFieldValues(GetRecords($myquery, "xxxxxxx"), 3)), ";")+1

I hope this will help.


------------------------------
Razi D.
Desta Tech LLC
razi@destatechs.com
------------------------------

MarkShnierYou
Forum|alt.badge.img+22
  • Quickbase Alumni
  • October 29, 2021
Sorting is not currently supported.  One assumes they are watching how Performance is going and being cautious before allowing more load on the system.

------------------------------
Mark Shnier (YQC)
mark.shnier@gmail.com
------------------------------

Forum|alt.badge.img
  • Quickbase Alumni
  • August 6, 2024

Late to the game here and not sure if this solves your specific use case, but if you're just needing them numbered in order dynamically based on your query you could use the Size function.  

For Example if i have 1,000 students on the students table related to a Class on the class table, I could sort them by Date/Time they signed up for the class and then record ID by saying 

//assume Date Joined is fid 30, Related Class is fid 20, and RID is 3 (per default)

var number position = Size(GetRecords("{3.LT.'"&[Record ID#]&"'}AND{30.LT.'"&[Date Joined]&"'}AND{20.EX.'"&[Related Class]&"'}"))

//add 1 to start index at 1 instead of 0

$position+1

This gives you the number of students that joined the Class they're Related to before the current record telling you if they were first (because the query = 0 and then we add 1) 545th or 1000th