Skip to main content
Question

Sort records returned from an advanced query pipeline step?

  • Jan 14, 2026 9:04 PM UTC
  • 4 replies
  • 294 views

JonathanGibson47609
Forum|alt.badge.img+6

I have a pipeline with a search records step using an advanced query. It is successfully returning the records I'm after, but I would like to also sort the results so I can grab a particular one.

Is it possible to specify options for an advanced query within a pipeline search records, or am I limited to just a simple query string? The documentation doesn't mention how to incorporate other params in a pipeline just the query string.

My current query string:
{'3'.XEX.{{a.id}}}AND{'16'.EX.'Update'}

Thanks!

4 replies

MarkShnierYou
Forum|alt.badge.img+24
  • Qrew Champion
  • Jan 14, 2026 9:20 PM UTC

I don't believe there is a sort parameter. I fed your question to ChatGPT and it agreed with me. I also asked ChatGPT if it comes back in Record ID sequence and it said "usually but not always".  

Then it started to hallucinate about API_RunReport which does not exists.

But I think there might be a path with API_DoQuery as that does allow for a Sort parameter.  I'm afraid I'm not technical enough to tell you what to do with the response from the API but I imagine it is in JSON format and so either ChatGPT or someone more technical like the Quickbase Junkie would be able to give you some consulting advice. ChatGPT is free. The Quickbase Junkie will likely have to charge for her time unless she happens to see this post and has a quick answer.  


JonathanGibson47609
Forum|alt.badge.img+6

Weird. I guess I don't understand what the advanced filter option is even for then. Simple filter seems preferable as long as long as you don't need to nest too many levels of logic, and if it isn't you're better off rethinking what you're doing if possible.


JeffRichey47779
Forum|alt.badge.img+4

Hi Jonathan,

I haven't experimented with this myself, but it seems you may be able to sort the results of your query using jinja.

I asked google for an example and it gave me this for a suggestion to sort by value.

{% for item in my_list | sort %}
    {{ item }}
{% endfor %}

Jeff Richey - Solutions Consultant - Quandary Consulting Group


Top Step
Forum|alt.badge.img+12
  • Observing
  • Oct 16, 2026 11:23 PM UTC

Search Records Advanced Query is only the where clause, so there's no place on that step to pass a sort.

The reliable way is a Make Request (or Fetch JSON) step against records/query with your same where clause, a sortBy on the field you need, and a top of 1. The first record that comes back is the one you want.

Example body:

{"from":"YOUR_TABLE_DBID","select":[3],"where":"YOUR_WHERE","sortBy":[{"fieldId":SORT_FID,"order":"DESC"}],"options":{"top":1}}

Without its own sort, Search Records falls back to the table's default report sort. That works until someone changes the default report without knowing your pipeline depends on it, so I'd keep the sort in the request.

https://developer.quickbase.com/operation/runQuery 

https://help.quickbase.com/docs/http-channel 

https://help.quickbase.com/docs/sort-option