API_DoQuery Not Pulling Records In Javascript

  • 0
  • 1
  • Question
  • Updated 6 months ago
  • Answered
I am having difficulties with utilizing the API_DoQuery through javascript.  Essentially any time I specify a query that involves field ID's other than the record ID, it returns no records.

The following is the URL used that is NOT returning records: 

https://targetdomain.quickbase.com/db/targetdbid?act=API_DoQuery&query={'31',EX,'ALE'}AND{'6',EX,'Q1318'}&clist=31.6.8.23.25.26&slist=8&apptoken=targetapptoken&fmt=structured


I've checked over and over that these are the appropriate field ID's and values, and that records exists that match this criteria; however, the request finds nothing.


Now this URL DOES return records:

https://targetdomain.quickbase.com/db/targetdbid?act=API_DoQuery&query={'3',GT,'0'}&clist=31.6.8.23.25.26&slist=8&apptoken=targetapptoken&fmt=structured

and the resulting XML has records with 

<f id="31">ALE</f>

<f id="6">Q1318</f>


Is there something I am missing?  I've even tried doing the first query separately rather than as a compound and that still returned nothing.  Any ideas as to why the query isn't working?


Photo of Jonathan Klein

Jonathan Klein

  • 182 Points 100 badge 2x thumb

Posted 7 months ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 27,884 Points 20k badge 2x thumb
You have commas in your query parameter rather than periods:

&query={'31',EX,'ALE'}AND{'6',EX,'Q1318'}

&query={'31'.EX.'ALE'}AND{'6'.EX.'Q1318'}

Also the single quotes are not needed:

&query={31.EX.ALE}AND{6.EX.Q1318}
Photo of Jonathan Klein

Jonathan Klein

  • 182 Points 100 badge 2x thumb
Sorry for the late reply, but thanks for the correction; my script now pulls the right data when using periods.  I'm curious though as to how the second query example ({'3',GT,'0'}) managed to work fine whereas the first one returned nothing despite both utilizing commas.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 27,884 Points 20k badge 2x thumb
Although the query is malformed, the combination of QuickBase parsing rules and default parameters is probably allowing the query to survive and return records.

Surprisingly this URL still returns the default query even though no query is specified and there is other noise in the URL:

https://login.quickbase.com/db/6ewwzuuj/this/space/for/rent?a=q&happy=birthday
(Edited)