Use API_GenResultsTable to embed a QuickBase table report in an HTML page.
This call is typically used in its URL form embedded in an HTML page. When the HTML page is opened in a browser, the call runs automatically and returns results to qdbWrite() for display in the HTML page.
You can also specify that the results should be returned as a JavaScript array, in CSV format, or as tab separated values.
By default, API_GenResultsTable returns the same number of rows as would be returned in the UI. However, you can specify a different number of rows in your table by including num-n in your options parameter, where specify the number of rows to return.
You can split a result set into several tables by calling API_GenResultsTable once for each table, using the skp option after the first invocation to skip over the records already returned.
Note: Refer to the article, What are the most common actions that affect QuickBase performance?, for tips on optimizing performance when creating queries.
Use the following procedure to embed a QuickBase report into a Web page on your Web site:
In your QuickBase application, create the table report that
you want to embed.
Note: API_GenResultsTable
should only be used with table reports.
In the HEAD section of your Web page, add the following <script> block:
<script lang="javascript" src="https://quickbase.com/
db/my_dbid?a=API_GenResultsTable&qid=5&jht=1"l&ticket=myticket>
</script>
In this block, the my_dbid should be the table ID you want and myticket is replaced with a valid authentication ticket. (If you don’t supply a ticket, the QuickBase login form appears when the page is opened and the user will have to log in first.) You can also supply your own query here, replacing <qid>5</qid> with your own query. See API_DoQuery for information on building a query.
In the HEAD section of your Web page, add the following style information:
<style>
td.m { font-family:verdana; font-size:70%; }
td.hd { font-family:verdana; font-size:70%; font-weight:bold; color:white;}
</style>
By changing the attributes of these CSS tags, you can modify the format of the resulting table.
In the area of the Web page where you want the HTML table to display, add the following JavaScript code:
<script lang="javascript">
qdbWrite();
</script>
| Parameter | Value | Required? |
query or qid or qname |
Specifies the query. You can use any of these three options:
|
no |
clist |
A period-delimited list of field IDs to be returned. QuickBase will return values for these field IDs in the order in which you enter them here. To return all fields in a table, set this parameter to the value a. Omit this parameter if you want the query to return the table's default columns. |
no |
slist |
A period-delimited list of field IDs used to determine sorting as follows: <slist>fid</slist> The following slist parameter sorts all records by the field whose fid is 7. <slist>7</slist> You can specify a secondary sort by including another fid in the string (separating each fid with a period) <slist>7.12</slist> URL example: &slist=7.12 If you don’t specify the sort list, the default sort specified on the Report Layout page determines the order in which records are displayed. |
no |
jht |
Returns the HTML for a table as a JavaScript function named qdbWrite(). You can then embed the HTML table into a Web page by calling the JavaScript function in the area of the Web page where you want the table to display. Set the value of the parameter to ‘n’ if you want the new look and feel introduced on Apr-12-2003. Set the value of this parameter ‘1’ if you want the CSS styles that render the HTML table with the QuickBase look and feel prior to Apr-11-2003. |
|
jsa |
Set this parameter to 1 if you want the results returned as a JavaScript array. |
|
options |
A period-delimited list containing any or any combination of the following options:
|
yes |
ticket |
A valid authentication ticket. The authentication ticket is returned via the API_Authenticate call. |
yes |
apptoken |
A valid application token. |
yes, if the application requires application tokens |
udata |
A string value that you want returned. It will not be handled by QuickBase but it will be returned in the response. |
no |
If you specify the jht option, the results are written to qbdWrite() embedded in the HTML page. Optionally, if you specify CSV or tab in the options parameter, the return will be comma separated values (CSV) or tab separated values, respectively. If you specified jsa, the javascript array is returned.
POST https://<target_domain>/db/bddfa5nbx
HTTP/1.0
Content-Type: application/xml
Content-Length:
QUICKBASE-ACTION: API_GenResultsTable
<qdbapi>
<ticket>2_bdh78chd4_dpsx_b_dnbypa8d372j5rb6vt6kfdx7ty25</ticket>
<apptoken>dtmd897bfsw85bb6bneceb6wnze3</apptoken>
<query>{'11'.CT.'Bob'}AND{'19'.GTE.'5'}</query>
<clist>6.7.9.11.16</clist>
<slist>11.6</slist>
<fmt>structured</fmt>
<options>num-4.sortorder-D</options>
</qdbapi>
https://<target_domain>/db/6c5xatxy?act=API_GenResultsTable&ticket=
<your_ticket>&apptoken=dtmd897bfsw85bb6bneceb6wnze3&qid=5&jht=1query=
{'6'.CT.'done'}AND{'14'.CT.'USA'}&clist=7.8&slist=6&options=sortorder-A
where <target_domain> is the domain against which you are invoking this call, for example, intuit.quickbase.com.
<html>
<head>
<script lang="javascript" src="https://quickbase.com/db/5rh82jcq?a=API_GenResultsTable
&ticket=2_bdh78chd4_dpsx_b_dnbypa8d372j5rb6vt6kfdx7ty25&apptoken=dtmd897bfsw85bb6bneceb6wnze3
&qid=5&jht=1">
</script>
<style>
td.m { font-family:verdana; font-size:70%; }
td.hd { font-family:verdana; font-size:70%; font-weight:bold;
color:white;}
</style>
</head>
<body>
<h1>Example</h1>
<table cellpadding=5 bgcolor=lightgreen>
<tr>
<td valign=top
nowrap><b>A QuickBase table<br>embedded in
a<br>page
of HTML
</td>
<td>
<script
lang="javascript">
qdbWrite();
</script>
</td>
</tr>
</table>
</body>
</head>
</html>
© 1999-2013 Intuit Inc. All rights reserved. Legal Notices.