Our Knowledge Base covers a wide variety of technical topics, from the basic to the complex.
Home / QIN / Knowledge Base / How do I display a table using API_GenResultsTable and the jsa option?
Knowledge Base
How do I display a table using API_GenResultsTable and the jsa option?
The HTML to display the List All report from the "6mztyxu8" table looks like this:
<html>
<head>
<SCRIPT Language="JavaScript" src="https://www.quickbase.com/db/6mztyxu8?a=API_GenResultsTable&qid=1&jsa=1">
</SCRIPT>
<SCRIPT Language="JavaScript">
function WriteTable() {
document.write("<TABLE align=center border=0 cellspacing=2 cellpadding=2 bgcolor=#ffffff class=verdana>");
document.write("<THEAD style='display:table-header-group'><TR class=hd bgcolor=#505050>");
for( var fieldcounter = 0; fieldcounter < qdb_numcols; fieldcounter++)
{
document.write("<TD CLASS=hd><font color=white>"+qdb_heading[fieldcounter]+"</font></TD>");
}
document.write("</TR></THEAD><tbody style='display:table-row-group'>");
var rowcount=0;
for(var rowcounter= 0; rowcounter < qdb_numrows; rowcounter++)
{
document.write("<TR class=od bgcolor=#e0e0e0 valign=top>");
for( var fieldcounter = 0; fieldcounter < qdb_numcols; fieldcounter++)
{
document.write("<TD CLASS=m>"+qdb_data[rowcounter][fieldcounter]+"</TD>");
}
document.write("</TR>");
}
document.write("</tbody></TABLE>");
}
</SCRIPT>
</head>
<body>
<SCRIPT LANGUAGE="JavaScript">
WriteTable();
</SCRIPT>
</body>
</html>
To make this work for your application all you need to do is change the dbid in the URL of the src attribute of the first JavaScript tag. To see this page in action please click on the link below:
https://www.quickbase.com/db/6mztyxu8?act=DBpage&pagename=api_genresults...
NOTE: QuickBase recommends that you use application tokens when working with API calls (read more about tokens at https://www.quickbase.com/help/app_tokens.html). Alternatively, you can leave the application's token requirement set to disabled.
- 34625 reads
Rate This
Similar Articles
Browse by Category
Knowledge Base Categories
- Accounts (35)
- Application (45)
- E-Mail (7)
- Fields (41)
- Forms (20)
- Formulas (18)
- General (68)
- Other Product (7)
- Pages (1)
- Product (5)
- Reports (15)
- Roles (4)
- Search (1)
- Tables (6)
Formula Category
about_http_API
access
add
API
APIs
application
applications
automatically
billing
buttons
change
copy
email
error
exact form
excel
export
field
fields
form
formula
formulas
formula URL
http_api
IP
issues
limit
limits
page
password
patches
plan
QuickBase
records
Release Notes
release notes
remove
report
reports
SDK
security
September 30
software
space
status
techfest
user
users
video
view



Comments
Thanks Earl
Great input!
Need to include a Query ID (qid)
This is great. However, need to include a query iD. to correct change to the following:
<SCRIPT Language="JavaScript" src="https://www.quickbase.com/db/6mztyxu8?a=API_GenResultsTable&qid=1&jsa=1">
Post new comment