Skip to main content
Question

API_DoQuery Not Pulling Records In Javascript

  • May 25, 2018
  • 0 replies
  • 59 views

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?


This topic has been closed for replies.

  • Registered
  • May 25, 2018
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}

  • Author
  • Registered
  • May 31, 2018
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.

  • Registered
  • May 31, 2018
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