302 Found

Found

The document has moved here.

Knowledge Base

Our Knowledge Base covers a wide variety of technical topics, from the basic to the complex.

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.

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

The content of this field is kept private and will not be shown publicly.
Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.
302 Found

Found

The document has moved here.