Forum Discussion

JAKQB_Admin's avatar
JAKQB_Admin
Qrew Trainee
6 years ago

API_DoQuery Not Pulling Records In Javascript

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?


3 Replies

  • 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}
  • 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.