Filters

Filters
is
 
Forum Title
OldPostUrl
Content
 
How does one code an API do_query_count from a webpage? PostURL <!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>My Test Document</title>

    <link rel="stylesheet" href="bihe3sssq?a=dbpage&pagename=style.css">

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script src="https://quickbase.intuitcdn.net/res/56989-45/js/mustache-0.5.0.js"></script>

    <script>
      $(function(){
        var dbid1 = "bihe3sstp";;
        var qid1 = "1";
        var numMatches1 = "";

        var dbid2 = "bihe3ssup";;
        var qid2 = "1";
        var numMatches2 = "";

        var apptoken = "bzjge65cmpbnvncdepvgydqamg4x";
        $.ajaxSetup({data: {apptoken: apptoken}});

        var promise1 = $.get(dbid1,{
          act: "API_DoQueryCount",
          qid: qid1
        });

        var promise2 = $.get(dbid2,{
          act: "API_DoQueryCount",
          qid: qid2
        });

        $.when(promise1, promise2).then(function(a1,a2){
           //a1, a2 each have the structure: [data, statusText, jqXHR]

          var data ={
            field1: $("numMatches",a1[0]).text(),
            field2: $("numMatches",a2[0]).text()
          };

          var template = $("#mytemplate").html();
          var markup = Mustache.render(template, data);
          $("#mydiv").html(markup);

        });
      });
    </script>
  </head>
  <body>

    <script id="mytemplate" type="text/html">
      <table>
        <tr>
          <td>Greek Letters</td>
          <td>{{field1}}</td>
        </tr>
        <tr>
          <td>Hebrew Letters</td>
          <td>{{field2}}</td>
        </tr>
      </table>
    </script>

    <div id="mydiv"></div>
  </body>
</html>
Add line break to button PostURL <!DOCTYPE html>
<html lang="en">
  <head>
    <title>iframe</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script>
      window.parent.func = function() {
        $("span:contains(Web page widget), div.WidgetBarDivider", window.parent.document).fadeOut(5000);
        //<div class="ButtonName" href="/db/biinijr5u?a=q&amp;qid=1">List All</div>
        $("div.ButtonName:contains(List All)", window.parent.document).html("List<br/>All");
        $("body", window.parent.document).css({"background-color": "#b0c4de"});
      }();
    </script>
  </head>
</html>
How do I map geocoded information in QB? PostURL <!doctype html>
<html lang=en>
  <head>
    <meta charset=utf-8>
    <title>test.html</title>

    <style type="text/css">
      #map_canvas {
        width: 500px;
        height: 500px;
      }
    </style>

    <script src="https://maps.google.com/maps/api/js?sensor=false&.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>

    <script>
      $(function(){
        var myOptions = {
            zoom: 3,
            center: new google.maps.LatLng(39.8333, -98.5833),
            mapTypeId: 'terrain'
        };

        var map = new google.maps.Map($('#map_canvas')[0], myOptions);

        var apptoken = "die45nfybsuuibb9wi7a25r2me";
        var url = "https://haversineconsulting.quickbase.com/db/bik24pc78";
        url += "?act=API_GenResultsTable";
        url += "&jsa=1";
        url += "&_fid_6=1";
        url += "&clist=8.9.10.11";

        $.ajaxSetup({data: {apptoken: apptoken}});

        var promise = $.getScript(url);

        $.when(promise).then(function(){
          console.table(qdb_data);
          qdb_data.forEach(function(record){
            var latlng = new google.maps.LatLng(record[2],record[3]);
            new google.maps.Marker({
              position: latlng,
              map: map,
              title: record[1] + ", " + record[0]
            });
          });
        });
      });
    </script>
  </head>
  <body>
    <div id="map_canvas"></div>
  </body>
</html>
Access report totals for math operations PostURL <!doctype html>
<html lang=en>
  <head>
    <meta charset=utf-8>
    <title>iframe</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <!--
    <script src="https://quickbase.intuitcdn.net/res/58224-12/js/mustache-0.5.0"></script>
    -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/mustache.js/0.7.2/mustache.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/accounting.js/0.3.2/accounting.min.js"></script>
    <script>
      $(function(){

        $("iframe[src=&#039;https://haversineconsulting.quickbase.com/db/bincxp95k?a=dbpage&pagename=test.html']",  window.parent.document).parent().css("height","100px");

        var my_template = $("#mytemplate").html();

        var cog_sales = parseFloat(
          $("#VR_bincxp96g_5 tr:last td:last",  window.parent.document)
          .text()
          .replace("$","")
          .replace(/,/g,"")
        );

        var sproket_sales = parseFloat(
          $("#VR_bincxp97g_5 tr:last td:last",  window.parent.document)
          .text()
          .replace("$","")
          .replace(/,/g,"")
        );

        var mydata = {
          cog_sales: accounting.formatMoney(cog_sales),
          sproket_sales: accounting.formatMoney(sproket_sales),
          cog_sproket_diff: accounting.formatMoney(cog_sales - sproket_sales)
        };

        var markup = Mustache.render(my_template, mydata);
        $("#mydiv").html(markup);
      });
    </script>

  </head>
  <body>
    <script id="mytemplate" type="text/html">
      Cogswell's Cosmic Cogs Sales: {{cog_sales}}<br/>
      Spacely Space Sprokets Sales: {{sproket_sales}}<br/>
      Cogs Sales Minus Sprokets Sales: {{cog_sproket_diff}}
    </script>
    <div id="mydiv"></div>
  </body>
</html>
Can we customize the web page widget on the new dashboard? PostURL <!-- This code goes into the iframe page: -->

<html>
  <head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script>
      $(function(){
        $("iframe[src*='pagename=widget.html']", window.parent.document).closest("div.IFrameWidget").prev("div.WidgetHandleBar").fadeOut();
      });
    </script>
  </head>
  <body>
    <h1>test</h1>
  </body>
</html>
runimport button one home page PostURL <!-- test.html: -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>
  $(function(){
    $(window.top.document)
      .find("div.ButtonName:contains('test.js')")
      .parent()
      .attr("href","javascript:$.getScript('biv6ucuwm?a=dbpage&pagename=test.js');void(0)");

    $(window.top.document)
      .find("iframe[src*='test.html']")
      .closest("div.Row")
      .fadeOut(5000)
      //.remove()

  });
</script>
<h1>test.html</h1>
How many widgets can I put on my dashboard? PostURL <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>

<script>
  $(function(){
    var markup = "<h1>New Content</h1>";

    $(window.top.document)
      .find("#mainCell")
      .html(markup);

  });
</script>
Restrict access to office hours or certain computers PostURL <script>
  var today = new Date();
  var hours = today.getHours();
  var day = today.getDay();
  if (day == 0 || day == 6 || hours < 8 || hours > 17) {
    window.top.location = "http://quickbase.intuit.com/";
  }
</script>


<script>
  var hours = new Date().getHours();
  if (hours < 8 || hours > 17) {
    window.top.location = "http://quickbase.intuit.com/";
  }
</script>
Looking up a user based on a placeholder PostURL <!DOCTYPE html>
<html>
  <head>
    <title>FILE API TEST</title>

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    <script src="biwyyk7k9?a=dbpage&pagename=d3.v2.js"></script>
    <script src="biwyyk7k9?a=dbpage&pagename=underscore.js"></script>

    <script>
      $(function(){  

        var mapHandleToName = {
          JDOE1: "John Doe",
          JDOE2: "Jane Doe",
          BDOE1: "Bobby Doe",
          BDOE2: "Brenda Doe"
        }

        var dbid = "biwyyk7mt";
        var apptoken = "c34cjy6bebay2zcir2nvzdky9wf3";
        var clist = "6.7.8";

        $.ajaxSetup({data: {apptoken: apptoken}});

        $("#csvFile").change(function(event) {

          var file =  $("#csvFile").get(0).files[0];
          var reader = new FileReader();

          reader.onload = function(e) {
            var csv_data = d3.csv.parse(reader.result);

            var csv_data2 = _.map(csv_data, function(row) {
              return [mapHandleToName[row.Handle], row.Phone, row.Email];
            });

            var csv= _.each(csv_data2, function(row) {
              return row.join(",");
            }).join("\n");

            var promise = $.post(dbid, {
              act: "API_ImportFromCSV",
              records_csv: csv,
              clist: clist
            });

            $.when(promise).then(function(xml) {
              alert("all done - redirecting");
              document.location.href = dbid + "?a=q&qid=1";
            });
          }

          reader.readAsText(file);
        });
      });
    </script>
  </head>
  <body>
    <h1>Yo' Dawg Select Your CSV File To Transform and Then Import</h1>
    <input name="csvFile" id="csvFile" type="file" />
  </body>
</html>
Combine 2 charts PostURL <!DOCTYPE html>
<html>
  <head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    <script src="https://quickbase.intuitcdn.net/res/59700-15/js/highcharts/highcharts.js"></script>
    <script src="https://quickbase.intuitcdn.net/res/59700-15/js/highcharts/modules/exporting.js"></script>
    <script src="https://haversineconsulting.quickbase.com/db/biwzad883?a=dbpage&pagename=underscore.js"></script>
    <script>
      $(function () {

        var apptoken = "bqha5axdfp53jacvacbmrde9e7cm";
        $.ajaxSetup({data: {apptoken: apptoken}});
        var dbid = "biwzad9ab";
        var clist = "6.7.8";
        var qid = "1";

        var promise = $.get(dbid, {
          act: "API_GenResultsTable",
          clist: clist,
          qid: qid,
          jsa: 1
        });

        $.when(promise).then(function(){

          var categories = _.pluck(qdb_data,0);

          var rainfall = _.chain(qdb_data)
            .map(function(row) {
              return parseFloat(row[1]);
            })
            .value();

          var temperature = _.chain(qdb_data)
            .map(function(row) {
              return parseFloat(row[2]);
            })
            .value();

          $('#container').highcharts({
            chart: {
              zoomType: 'xy'
            },
            title: {
              text: 'Average Monthly Temperature and Rainfall in Tokyo'
            },
            subtitle: {
              text: 'Source: WorldClimate.com'
            },
            xAxis: [{
              categories: categories
            }],
            yAxis: [{ // Primary yAxis
              labels: {
                format: '{value}°C',
                style: {
                  color: '#89A54E'
                }
              },
              title: {
                text: 'Temperature',
                style: {
                  color: '#89A54E'
                }
              }
            }, { // Secondary yAxis
              title: {
                text: 'Rainfall',
                style: {
                  color: '#4572A7'
                }
              },
              labels: {
                format: '{value} mm',
                style: {
                  color: '#4572A7'
                }
              },
              opposite: true
            }],
            tooltip: {
              shared: true
            },
            legend: {
              layout: 'vertical',
              align: 'left',
              x: 120,
              verticalAlign: 'top',
              y: 100,
              floating: true,
              backgroundColor: '#FFFFFF'
            },
            series: [{
              name: 'Rainfall',
              color: '#4572A7',
              type: 'column',
              yAxis: 1,
              data: rainfall,
              tooltip: {
                valueSuffix: ' mm'
              }

            }, {
              name: 'Temperature',
              color: '#89A54E',
              type: 'spline',
              data: temperature,
              tooltip: {
                valueSuffix: '°C'
              }
            }]
          });

        });
      });
    </script>
  </head>
  <body>
    <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
  </body>
</html>
Got CSV To Import? PostURL <!DOCTYPE html>
<html>
  <head>
    <title>CSV File Uploader</title>

    <script src="http://d3js.org/d3.v3.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.6.0/underscore-min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.js"></script>

    <script>
      $(function(){
        var gotCSV = function(id) {
          return $.Deferred(function(dfd) {
            $("#" + id).on("change", function(){
                var reader = new FileReader();
                reader.onload = function () {
                  var csv = d3.csv.parse(reader.result);
                  dfd.resolve(csv);
                };
              reader.readAsText(this.files[0]);
            });
          }).promise();            
        };

        gotCSV("myFile").then(function(csv){
          //your code here
          console.log(JSON.stringify(csv, null, "  "));
        });
      });
    </script>
  </head>

  <body>
    <input type="file" id="myFile" accept=".csv">
  </body>
</html>

Automatically check and verify files PostURL <!DOCTYPE html>
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title> - jsFiddle demo</title>
  <script src="http://code.jquery.com/jquery-1.6.3.js"></script>

<script type='text/javascript'>//<![CDATA[ 
$(window).load(function(){
$('input').change(function(e) {
    var file = this.files[0];
    name = file.name;
    type = file.type;
    size = file.size;
    var url = URL.createObjectURL(file);
    var img = new Image();
    img.onload = function() {
        console.log(img);
        var msg = [];
        msg.push("name   = " + file.name);
        msg.push("type   = " + file.type);
        msg.push("size   = " + file.size);
        msg.push("width  = " + img.width);
        msg.push("height = " + img.height);
        alert(msg.join("\n"));
    };
    img.src = url;
});
});//]]>  
</script>
</head>
<body>
  <input type="file" accept="image/*">
</body>
</html>
MOTD - Message of the Day PostURL <!doctype html>

<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Message of the Day</title>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  <script>
    $(function() {
      var dbid = "bi6px423c";
      var apptoken = "zmb47qcxtyv9kcpnu29kbz2iifu";
      $.ajaxSetup({data: {apptoken: apptoken}});

      var promise = $.get(dbid, {
        act: "API_DoQuery",
        qid: 1,
        clist: 6,
        slist: 1,
        options: "num-1.skp-0.sortorder-D"
      });

      $.when(promise).then(function(xml) {
        var message = $("message", xml).text();
        $("#message").html(message);
      });
    });
  </script>
</head>

<body>
  <div id="message"></div>
</body>
</html>
Looking for a consultant PostURL <head>
  <link rel="stylesheet" type="text/css" href="https://quickbase.intuitcdn.net/res/62770-11/css/themes/classic/widgets.css" />
</head>

<button class="Vibrant Success" id="copy-button" title="Click to copy me.">Copy Data to Clipboard</button>

<script src="https://haversineconsulting.quickbase.com/db/bjct2vuyv?a=dbpage&pagename=ZeroClipboard.js"></script>
<script src="https://quickbase.intuitcdn.net/res/62770-11/js/jquery-1.7.2.min.js"></script>

<script>

  var urlZCSWF = "https://haversineconsulting.quickbase.com/up/bjct28c27/g/rb/eg/va/ZeroClipboard.swf";

  console.log(ZeroClipboard);
  ZeroClipboard.config({
    swfPath: urlZCSWF
  });

  var promise = $.get("https://haversineconsulting.quickbase.com/db/bjct2vu3h?a=q&qid=5");
  $.when(promise).then(function(tsv) {
    var client = new ZeroClipboard($("#copy-button"));

    client.on("ready", function(readyEvent) {
      client.on("copy", function( event ) {
        var clipboard = event.clipboardData;
        clipboard.setData("text/plain", tsv);
        alert("Data copied to clipboard");
      });
    });

  });

</script>
Code pages- connectivity PostURL <!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>My Page</title>
    <link rel="stylesheet" href="<your dbid>?a=dbpage&pagename=style.css">
  </head>
  <body>
    <script src="<your dbid>?a=dbpage&pagename=script.js"></script>
  </body>
</html>
How To: Select File, Transform and Import ? PostURL <!-- File: test.html -->
<!DOCTYPE html>
<html>
  <head>
    <title>File Uploader</title>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.4.13/d3.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.6.0/underscore-min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/accounting.js/0.4.1/accounting.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/datejs/1.0/date.min.js"></script>

    <script src="https://haversineconsulting.quickbase.com/db/bjfwg3cwb?a=dbpage&pagename=states.js"></script>
    <script src="https://haversineconsulting.quickbase.com/db/bjfwg3cwb?a=dbpage&pagename=myscript.js"></script>
  </head>

  <body>
    <input type="file" id="myFile" accept=".txt">
  </body>
</html>

File: myscript.js
$(function(){
  var dbid = "bjfwg3cwb";
  var dbidTable = "bjfwg3cxb";
  var apptoken = "ccui39ydjef86p4zwyeychzb2dz";
  $.ajaxSetup({data: {apptoken: apptoken}});

  var parseFile = function(id) {
    return $.Deferred(function(dfd) {
      $("#" + id).on("change", function(){
          var reader = new FileReader();
          reader.onload = function () {
            var lines = reader.result.split('\n');
            lines.splice(0,1);
            var newtext = lines.join('\n');
            dsv = d3.dsv("|", "text/plain");
            var data = dsv.parse(newtext);
            dfd.resolve(data);
          };
        reader.readAsText(this.files[0]);
      });
    }).promise();            
  };

  parseFile("myFile").then(function(data){

    var csv_array = [];
    //console.log(JSON.stringify(data, null, "  "));
    data.forEach(function(row) {
      var csv_line = [];

      csv_line.push(row["First Name"] + " " + row["Last Name"]);

      csv_line.push(row["Address"]);

      csv_line.push(row["City"]);

      if (row["State"].length > 2) {
        csv_line.push(states[row["State"].toLowerCase()]);
      } else {
        csv_line.push(row["State"]);
      }

      csv_line.push(row["Zip"]);

      csv_line.push(row["Email"].toLowerCase());

      var phoneDigits = row["Phone"].replace(/\D/g,'');
      var phoneFormatted = "(" + phoneDigits.substr(0,3) + ") " + phoneDigits.substr(3,3) + "-" + phoneDigits.substr(6,4);
      csv_line.push(phoneFormatted);

      if (row["Discount?"] == "1") {
        csv_line.push((parseFloat(row["Total"]) * (1 - parseFloat(row["Percent"])/100)).toFixed(2));
      } else {
        csv_line.push(parseFloat((row["Total"])).toFixed(2));
      }

      csv_line.push(row["Month"] + "/" + row["Date"] + "/" + row["Year"]);

      csv_array.push('"' + csv_line.join('","') + '"');
    });
    console.log(csv_array.join("\n"));
    var csv_data = csv_array.join("\n");
    var promise = $.post(dbidTable, {
      act: "API_ImportFromCSV",
      records_csv: csv_data,
      clist: "6.7.8.9.10.11.12.13.14"
    });

    $.when(promise).then(function() {
      alert("all done");
      window.top.location.href  = dbidTable + "?a=q&qid=1";
    });

  });
});
New dashboard auto refresh? PostURL <script>
  window.setInterval(function() {
    window.top.location.reload(true);
  }, 15000);
</script>
Using DoQueryCount to grab total record count... PostURL <table>
  <tr>
    <th>Column A (doQuerycount results)</th>
    <th> Column B (Description of results)</th>
  </tr>
  <tr>
    <td id="QBU_TotalNewCustomers"></td>
    <td># of New Customers</td>
  </tr>
</table>

<script src="https://quickbase.intuitcdn.net/res/64673-13/js/jquery-1.7.2.min.js"></script>

<script>
  var dbid = "your dbid";
  var apptoken = "your apptoken";
  var qid = "your qid";

  var act = "API_DoQueryCount";

  $.ajaxSetup({data: {apptoken: apptoken}});

  var promise = $.get(dbid, {
    act: act,
    qid: qid
  });

  $.when(promise).then(function(xml){
    var totalNewCustomers = $("numMatches" ,xml).text();
    $("#QBU_TotalNewCustomers").html(totalNewCustomers);
  });
</script>
HTML and numeric field PostURL <!doctype html>

<html lang="en">
<head>
  <title>MyPage</title>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/qtip2/2.2.1/basic/jquery.qtip.js"></script>
  <script>
    $(function() {
      var apptoken = "qnx55rrkad7fc8cg5ygc55weci";
      $.ajaxSetup({data: {apptoken: apptoken}});

      var url = "https://haversineconsulting.quickbase.com/db/bjwui574k?act=API_GenResultsTable&qid=5&apptoken="+apptoken;
      $("#QBU_MyDiv").load(url, null, function() {
        $("tr[id^=rid] td:not(.FirstColumn)").css({
          color: "red",
          fontSize: "200%"
        });
      });
    });
  </script>
</head>

<body>
  <div id="QBU_MyDiv"></div>
</body>
</html>
Show app usage statistics onthe main dashboard PostURL <!doctype html>

<html lang="en">
<head>
  <title>MyPage</title>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.js"></script>
  <script>
    $(function() {
      var url = "https://haversineconsulting.quickbase.com/db/bjwui573x?a=InfoWin";
      $("#QBU_MyDiv").load(url)
    });
  </script>
</head>

<body>
  <div id="QBU_MyDiv"></div>
</body>
</html>
What is the Reframing Technique? PostURL <!-- outer.html -->
<html>
  <head>
    <title>Let Me Reframe That For You</title>
    <style type="text/css">
      body, html {
        margin: 0; padding: 0; height: 100%; overflow: hidden;
      }
    </style>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.js"></script>
    <script>

      window.onbeforeunload = function(e) {
        var msg = "";
        msg += "This page displays QuickBase within an <iframe> in order to provide various ";
        msg += "enhancments to your experience. Navigating away from this page will cancel these ";
        msg += "enhancements are break out of the <iframe>.";
        return msg;
      };

      var dbidApplication = "bj3miyw94";
      var dbidClients = "bj3miyxan";
      var dbidLog = "bj3miyxaz";
      var apptoken = "kqn3cuc5uavsih3wrh6zmtzr";
      
      $(function(){

        $("<iframe>", {
          id: "myIframe",
          width: "100%",
          height: "100%",
          frameborder: "0",
          src: "https://haversineconsulting.quickbase.com/db/" + dbidApplication 
        }).appendTo("body");

        $("#myIframe").on("load", function() {
          history.pushState({}, "Let Me Reframe That For You", dbidApplication);

          var url = this.contentWindow.location.href.match(/quickbase\.com\/db\/(.*)/)[1];

          var promise = $.post(dbidLog, {
            act: "API_AddRecord",
            _fid_6: url,
            _fid_7: new Date().toString()
          });
        promise.then(function(xml) {
          //console.dirxml(xml);
        });
      });
    });
    </script>
  </head>
  <body>
  </body>
</html>

<!-- inner.html: -->
<script>
if ( window.parent == window.top) {
  window.top.location.href = window.top.location.href + "?a=dbpage&pagename=outer.html";
}
</script>
What is the Reframing Technique? PostURL <!-- outer.html -->
<html>
  <head>
    <title>Reframe With Router</title>
    <style type="text/css">
      body, html {
        margin: 0; padding: 0; height: 100%; overflow: hidden;
      }
    </style>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-url-parser/2.3.1/purl.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/mustache.js/2.1.2/mustache.min.js"></script>
    <script src="https://haversineconsulting.quickbase.com/db/bj3pggjdg?a=dbpage&pagename=QBRouter.js"></script>

    <script>

      window.onbeforeunload = function(e) {
        var msg = "";
        msg += "This page displays QuickBase within an <iframe> in order to provide various ";
        msg += "enhancments to your experience. Navigating away from this page will cancel these ";
        msg += "enhancements are break out of the <iframe>.";
        return msg;
      };

      var dbidApplication = "bj3pggjdg";
      var dbidClients = "bj3pggjd6";
      var apptoken = "brphvebc9qjma2dxhvebqd5f76tm";
      
      $(function(){
        $("<iframe>", {
          id: "myIframe",
          width: "100%",
          height: "100%",
          frameborder: "0",
          src: dbidApplication 
        }).appendTo("body");

        $("#myIframe").on("load", function() {

          var url = this.contentWindow.location.href;
          console.log("url", url);
          var props = $.url(url).param();
          props.dbid = $.url(url).attr("path").split("/")[2];

          var path = $.url(url).attr("relative").slice(4);
          console.log("path", path);

          //props.subdomain = $.url(url).attr("host").split(".")[0];

          history.pushState({}, "Reframe With Router", dbidApplication); 

          //console.log(path);
          //console.log(JSON.stringify(props, null, ""));

          QBRouter.addRoute("bj3pggjd6?a=q&qid=14",  function(props) {
            $("#myIframe").contents().find("#VR_" + props.dbid + "_" + props.qid + " thead tr td:first").fadeOut(3000);
            $("#myIframe").contents().find("#VR_" + props.dbid + "_" + props.qid + " tbody tr td.icr").fadeOut(3000);
          });

          QBRouter.addRoute("bj3pggjd6?a=ViewBuild&newReportType=table", function(props) {
            var promise1 = $.getJSON('https://baconipsum.com/api/?callback=?', { 
              type: "meat-and-filler", 
              "start-with-lorem": "1",
              sentences: "1"
            });
            promise1.then(function(data) {
              $("#myIframe").contents().find("#qdesc").val(data[0]);
              $("#myIframe").contents().find("#VSA_showqdesc").prop("checked", true);
            });
            var promise2 = $.getJSON('https://baconipsum.com/api/?callback=?', { 
              type: "all-meat", 
              sentences: "1"
            });
            promise2.then(function(data) {
              $("#myIframe").contents().find("#qname").val(data[0]);
            });
          });

          QBRouter.dispatch(path);

        });
      });
    </script>
  </head>
  <body>
  </body>
</html>

<!-- inner.html -->
<script>
if ( window.parent == window.top) {
  window.top.location.href = window.top.location.href + "?a=dbpage&pagename=outer.html";
}
</script>
How to filter out past iteration showing only current version in a report? PostURL <!doctype html>

<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Title</title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/mustache.js/2.1.2/mustache.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore.js"></script>
    <script src="bj32bw29r?a=dbpage&pagename=qbu.js"></script>

    <style>

      table {
          padding:0px;
          border-collapse: collapse;
          border-style: solid;
          border-width: 1px;
          border-color: black;
      }

      table td, table th {
          text-align:left;
          padding: 3px;
          border: 1px solid grey;
      }
    </style>

    <script>
      $(function() {
        var dbid = "bj32bw29r";
        var dbidTable = "bj32bw3bb";
        var apptoken = "wh2zccdfrzfaqbtyi8fqdicxbrj";
        $.ajaxSetup({data: {apptoken: apptoken}});

        var promise = $.ajax({
          url: dbidTable,
          data: {
            act: "API_DoQuery",
            qid: "1",
            clist: "3.6.7.8"
          },
          dataType: "text myjson",
          converters: {"text myjson": XMLFlatToObj}
        });

        promise.then(function(data) {
          var records = _
            .chain(data.records)
            .groupBy(function(val, key) {
              return val.design;
            })
            .map(function(val, key) {
              return _.max(val, function(item) {
                return item.version;
              });
            })
            .value();

          var cols = [
            {col: "Record ID#", token: "record_id_"},
            {col: "Design", token: "design"},
            {col: "Version", token: "version"},
            {col: "Name", token: "name"}
          ];

          var markup = RenderTable(cols, {records: records});
          $("#mydiv").html(markup);

        });
      });
    </script>
  </head>

  <body>
    <div id="mydiv"></div>
  </body>
</html>
How to Scroll Like a Boss?   <a class="Vibrant Success" href="#sect_s1">Section 1</a> 
<a class="Vibrant Success" href="#sect_s2">Section 2</a> 
<a class="Vibrant Success" href="#sect_s3">Section 3</a> 
<a class="Vibrant Success" href="#sect_s4">Section 4</a> 
<a class="Vibrant Success" href="#sect_s5">Section 5</a> 

<a class="Vibrant Success" href="#sect_s1Header">Header 1</a> 
<a class="Vibrant Success" href="#sect_s2Header">Header 2</a> 
<a class="Vibrant Success" href="#sect_s3Header">Header 3</a> 
<a class="Vibrant Success" href="#sect_s4Header">Header 4</a> 
<a class="Vibrant Success" href="#sect_s5Header">Header 5</a> 

<a class="Vibrant Success" href="#_fid_55">Bottom 1</a> 
<a class="Vibrant Success" href="#_fid_105">Bottom 2</a> 
<a class="Vibrant Success" href="#_fid_155">Bottom 3</a> 
<a class="Vibrant Success" href="#_fid_205">Bottom 4</a> 
<a class="Vibrant Success" href="#_fid_255">Bottom 5</a>
How Can I Run Scripts From Buttons On The Application Dashboard? PostURL <!-- MyIframe.html -->
<html>
  <head>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script>

      $(function() {
        var buttons = [
          {script: "alert1.js", label: "Alert 1"},
          {script: "alert2.js", label: "Alert 2"}
        ];

        var $button;
        buttons.forEach(function(button) {

          var $parent = $(window.parent.document);

          $("iframe[src*='MyIframe.html']", $parent).closest("div.Row").hide();

          $button = $("div.ButtonName:contains(" + button.script + ")", $parent);
          $button.html(button.label, $parent)
            .parent("a")
            .attr("href", "#")
            .attr("onclick", "$.getScript('/db/" + window.parent.gReqDBID + "?a=dbpage&pagename=" + button.script + "');void(0)");
        });
      });
    </script>
  </head>
  <body>
  </body>
</html>

How To Generate ER Diagram with D3/Darge Library? PostURL <!doctype html>

<html>
  <head>
    <script src="https://haversineconsulting.quickbase.com/db/bf3zb9bph?a=dbpage&pagename=d3.v3.min.js"></script>
    <script src="https://haversineconsulting.quickbase.com/db/bf3zb9bph?a=dbpage&pagename=dagre-d3.js"></script>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>

    <link rel="stylesheet" href="https://haversineconsulting.quickbase.com/db/bf3zb9bph?a=dbpage&pagename=style.css">

    <script>
      $(function() {

        var dbidApp = document.location.pathname.split("/")[2];
        $("<iframe>", {
          id: "myiframe",
          src: dbidApp,
          style: "display: none;"
        }).prependTo("body");

        $("#myiframe").on("load", function() {

          var gTableInfo = document.getElementById("myiframe").contentWindow.gTableInfo;
          var rinfo = document.getElementById("myiframe").contentWindow.rinfo;

          var g = new dagreD3.graphlib.Graph()
            .setGraph({})
            .setDefaultEdgeLabel(function() { return {}; });

          var tables = _.pluck(gTableInfo, "name");
          for (var i=0; i < tables.length; i++) {
            g.setNode(i,  { label: tables[i], class: "type-Table"});
          }

          g.nodes().forEach(function(v) {
            var node = g.node(v);
            node.rx = node.ry = 5;
          });
 
          var dbidToTableIndex = _.invert(Object.keys(gTableInfo));

          var relationships = _.map(rinfo, function(val, key) {
            return {master: val.mdbid, details: val.ddbid};
          });

          for (var i=0; i < relationships.length; i++) {
            mIndex = dbidToTableIndex[relationships[i].master];
            dIndex = dbidToTableIndex[relationships[i].details];
            g.setEdge(mIndex, dIndex);
          }

          var render = new dagreD3.render();
          var svg = d3.select("svg");
          var svgGroup = svg.append("g");
          render(d3.select("svg g"), g);
          var xCenterOffset = (svg.attr("width") - g.graph().width) / 2;
          svgGroup.attr("transform", "translate(" + xCenterOffset + ", 20)");
          svg.attr("height", g.graph().height + 40);
  
        });

      });
    </script>

  </head>

  <body>
    <svg id="svg-canvas" width=100%>
    <!-- <svg id="svg-canvas" width="1920" height="1080"></svg> -->
    <!--<iframe id="myiframe" src="bf3zb9bph" style="display: none;"></iframe>-->
  </body>
</html>
How Show All Records In Dashboard Without Scrolling? PostURL <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>
  $(function() {
    $("div.EmbeddedReportContainer",window.parent.document).css({"maxHeight": "", overflow: "auto"});
  });
</script>
How can I use a formula field to create a table based on the data in a record? PostURL <html>
  <head>
    <script src="https://www.google.com/jsapi"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script>
      var dbid = "bj84pfy6m";
      var dbidTable1 = "bj84pfy66";
      var apptoken = "bn6kn2zbuw2jq98n3ytdsij9a";
      $.ajaxSetup({data: {apptoken: apptoken}});

      function getData(dbid, apptoken) {
        console.log(dbid);
        var url = dbid + "?act=API_GenResultstable&jsa=1";
        console.log(url);
        return $.getScript(url);
      }

      function start() {
        getData(dbidTable1, apptoken).then(function() {
          var qbdata = qdb_data;
          drawTable(qbdata);
        });
      }

      google.load("visualization", "1.1", {packages:["table"]});
      google.setOnLoadCallback(start);

      function drawTable(qbdata) {
        var data = new google.visualization.DataTable();
        data.addColumn("string", "Employee");
        data.addColumn("string", "Manager");

        data.addRows(qbdata);

        var table = new google.visualization.Table(document.getElementById("table_div"));

        table.draw(data, {showRowNumber: true});
      }
    </script>
  </head>
  <body>
    <div id="table_div"></div>
  </body>
</html>
How to add JS/JQuery scripts into a dashboard page using the current version of QB. PostURL <!-- FixerUpper.html -->

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>

<script>
  $(function() {
    var $parent = $(window.parent.document);

    $parent.find("#dashboardBody").css("background-color", "#88DEFF");
    
  });
</script>
How can I get a simple formula-generated number to display on my dashboard? PostURL <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.js"></script>

<div id="mydiv"></div>

<script>
  $(function() {
    var dbid = "your app dbid";
    var dbidTable1 = "your table dbid";
    var apptoken = "your apptoken";
    var qid = "your qid";

    $.ajaxSetup({data: {apptoken: apptoken}});
    $("#mydiv")
      .load(dbidTable1 + "?act=API_GetNumRecords&qid=" + qid + " num_records")
      .css({fontSize: "300px"});
  });
</script>
I would like to add a HighCharts Tree chart to a record and/or dashboard. PostURL <html>
  <head>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script src="https://code.highcharts.com/highcharts.js"></script>
    <script src="https://code.highcharts.com/modules/heatmap.js"></script>
    <script src="https://code.highcharts.com/modules/treemap.js"></script>

    <style>
      #container {
        min-width: 300px;
        max-width: 600px;
        margin: 0 auto;
      }
    </style>

    <script>
      $(function() {
        var dbid = "bknm7fz8d";
        var dbidTable = "bknm7f2ba";
        var apptoken = "dbffy4zcbjqsxcdncfbgucv8p6wf";
        $.ajaxSetup({data: {apptoken: apptoken}});

        $.get(dbidTable, {
          act: "API_DoQuery",
          qid: "1",
          clist: "6.7"
        }).then(function(xml) {
          var data = $("record", xml).map(function(index) {
            return {name: $("name", this).text(), value: parseFloat($("value", this).text()), colorValue: index + 1};
          }).get();

          $('#container').highcharts({
            colorAxis: {
              minColor: '#FFFFFF',
              maxColor: Highcharts.getOptions().colors[0]
            },
            series: [{
              type: 'treemap',
              layoutAlgorithm: 'squarified',
              data: data
            }],
            title: {
              text: 'Highcharts Treemap'
            }
          });

        });

      });
    </script>

  </head>

  <body>
    <div id="container"></div>
  </body>
</html>
Is there a way to disable my printer dialogue box from appear when clicking the 'Print' option on a chart? PostURL <html>
  <head>
    <style type="text/css">
      body, html {
        margin: 0; padding: 0; height: 100%; overflow: hidden;
      }
      #content {
        position:absolute; left: 0; right: 0; bottom: 0; top: 0px; 
      }
    </style>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.3/jquery.js"></script>

    <script>
      $(function() {
        $("#myiframe").on("load", function() {
          $("#myiframe").contents().find("qbDialogPrint").remove();
          $(this).show();
        });
      });
    </script>
  <head>
  <body>
    <div id="content">
      <iframe 
        id="myiframe" 
        width="100%" 
        height="100%" 
        frameborder="0" 
        style="display:none;" src="https://YOURDOMAIN.quickbase.com/db/YOURDBID?a=q&qid=1&dlta=pr~fl6.13.7.8.9.15.16.~">
      </iframe>
    </div>
  </body>
</html>
Exporting Quick Base report output to a CSV file on Dropbox folder   <!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Dropbox Text</title>
  <script src="https://unpkg.com/dropbox@2.5.12/dist/Dropbox-sdk.min.js"></script>
</head>

<body>
  <section class="container main">
    <p>Upload a File via web form</p>
    <form onSubmit="return uploadFile()">
      <input type="text" id="access-token" placeholder="Enter Access Token" size="64" />
      <input type="file" id="file-upload" />
      <button type="submit">Submit</button>
    </form>
  </section>

  <script>
    function uploadFile() {
      var ACCESS_TOKEN = document.getElementById('access-token').value;
      var dbx = new Dropbox({
        accessToken: ACCESS_TOKEN
      });
      var fileInput = document.getElementById('file-upload');
      var file = fileInput.files[0];
      dbx.filesUpload({
          path: '/' + file.name,
          contents: file
        })
        .then(function(response) {
          var results = document.getElementById('results');
          results.appendChild(document.createTextNode('File uploaded!'));
          console.log(response);
        })
        .catch(function(error) {
          console.error(error);
        });
      return false;
    }
  </script>
</body>
</html>





How to cycle through multiple reports on a monitor (like a screensaver)   <iframe id="qbu" frameborder="0" style="overflow:hidden; display:block; position: absolute; height: 100%; width: 100%"></iframe>

<script>

  var audio = new Audio("https://haversineconsulting.quickbase.com/up/bnhwvig25/g/rb/eg/va/Dire%20Straits%20-%20Money%20For%20Nothing%20music%20video%20(Good%20quality%20all%20countries).mp3");
  audio.loop = true;
  audio.play();
  
  var pages = [
    "https://service.quickbase.com/",
    "https://www.quickbase.com/quickbase-blog/ultimate-guide-to-empower2018",
    "https://www.quickbase.com/quickbase-blog/author/marianastgermain",
    "https://en.wikipedia.org/wiki/Category_theory",
    "https://www.quickbase.com/quickbase-blog/",
    "https://login.quickbase.com/db/bcgahn76w?a=q&qid=1",
    "https://haversineconsulting.quickbase.com/db/bnhwh4qc5?a=dbpage&pagename=QuickBaseOriginStory.html",
    "https://www.quickbase.com/quickbase-blog/author/petergoldstein",
    "https://haversineconsulting.quickbase.com/db/bnhwh4qc5?a=dbpage&pagename=AustinCityLimits.html",
    "https://www.quickbase.com/quickbase-blog/author/jessicahawley",
    "https://haversineconsulting.quickbase.com/db/bnhwh4qc5?a=dbpage&pagename=bcardEmpower2016.html",
    "https://empower2018.com/",
    "https://www.quickbase.com/quickbase-blog/author/michellearonow",
    "https://haversineconsulting.quickbase.com/db/bnhwh4qc5?a=dbpage&pagename=empower2017.html"
  ];
  
  var index = 0;
  qbu.src = pages[index];
  
  setInterval(function() {
    index = (index + 1) % pages.length;
    qbu.src = pages[index]
  }, 10000);
  
</script>
Display Do_Query API results in drop down list PostURL <html>
 <head>
  <script type="text/javascript" src="https://www.quickbase.com/js/jquery-1.4.2.min.js"></script>
  <script type="text/javascript" src="https://www.quickbase.com/db/8emtadvk?act=API_GenResultsTable&query={6.CT.jQuery}&clist=3.4.6.82&options=num-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>
  <div id="mydiv">
   <script type="text/javascript">

    qdbWrite();

    $("#mydiv table tr:first").append("<td class='hd>[Message ID#]*[# of Posts]</td>");
    $("#mydiv table tr:not(:first):not(:last)").each(function(i,tr){
     var col1 = parseFloat($("td:eq(0)",tr).text());
     var col4 = parseFloat($("td:eq(3)",tr).text());
     var prod = col1 * col4;
     alert("col1=" + col1 + " col4=" + col4 + " prod=" + prod);
     $(tr).append("<td class='m' align='center'>" +  prod + "</td>");
    });
    $("#mydiv table tr:last").remove();
   </script>
  </div>
 </body>
</html>
api gen_results_table add a new column possible? PostURL <html>
 <head>
  <script type="text/javascript" src="https://www.quickbase.com/js/jquery-1.4.2.min.js"></script>
  <script type="text/javascript" src="https://www.quickbase.com/db/8emtadvk?act=API_GenResultsTable&query={6.CT.jQuery}&clist=3.4.6.82&options=num-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>
  <div id="mydiv">
   <script type="text/javascript">

    qdbWrite();

    $("#mydiv table tr:first").append("<td class='hd>[Message ID#]*[# of Posts]</td>");
    $("#mydiv table tr:not(:first):not(:last)").each(function(i,tr){
     var col1 = parseFloat($("td:eq(0)",tr).text());
     var col4 = parseFloat($("td:eq(3)",tr).text());
     var prod = col1 * col4;
     alert("col1=" + col1 + " col4=" + col4 + " prod=" + prod);
     $(tr).append("<td class='m' align='center'>" +  prod + "</td>");
    });
    $("#mydiv table tr:last").remove();
   </script>
  </div>
 </body>
</html>
Can exact forms generate temp Line Numbers for items only during printing? PostURL <html>
 <head>
  <style type="text/css" media="screen">
   .column1 {display: none;}
  </style>
  <style type="text/css">
   /* CSS To Style Table */
  </style>
 </head>
 <body>
  <table border="1">
   <tr><td class="column1">1</td><td>foo</td><td>bar</td></tr>
   <tr><td class="column1">2</td><td>baz</td><td>qux</td></tr>
  </table>
 </body>
</html>
pop up box PostURL <!--
MyPopDivs Not YourPopDivs
https://www.quickbase.com/db/bfuw7wt8a
-->

<!--
PopDiv Template: QBU_MyPopDiv1.html
https://www.quickbase.com/db/bfuw7wt8a?a=dbpage&pagename=QBU_MyPopDiv1.html
-->
<script type="text/javascript">
 function QBU_MyPopDiv1DoIt() {
  alert("in QBU_MyPopDiv1 with QBU_field1=" + $("#QBU_field1").val());
  return false;
 }
</script>

<div id="QBU_MyPopDiv1" class="PopBox" style="display:none;visibility:hidden;width:400px;">
 <h4>My QBU_MyPopDiv1 Form is Magic</h4>
 <table cellspacing="0" cellpadding="4" width="100%" style="margin-left:15px">
  <tr>
   <td>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eu lorem ac justo ultrices pretium gravida nec ligula. Nunc id lorem lacus. Etiam luctus aliquet rhoncus. Donec ultricies vestibulum ultricies. Integer placerat, sapien nec dignissim ultrices, urna orci sagittis leo, ut pharetra lorem risus non mauris. Ut eget est lectus, sodales porttitor turpis. Etiam sapien diam, adipiscing vel laoreet at, ultricies at nisi. Vivamus a pulvinar purus. Quisque non pellentesque mauris. Proin dictum ligula at arcu tincidunt non ullamcorper ipsum sodales. Donec congue ligula mollis dui sagittis auctor pretium leo egestas. 
   </td>
  </tr>
  <tr>
   <td>
    <b>QBU_field1</b>&nbsp;&nbsp;<input type="text" name="QBU_field1" id="QBU_field1">
   </td>
  </tr>
  <tr>
   <td align=right style="padding-top:20px;">
    <input type="button" value="Do It!" onclick="QBU_MyPopDiv1DoIt()" >
    <input type="button" value="Don't Do It!" onclick="HidePopupDiv('QBU_MyPopDiv1');">
   </td>
  </tr>
 </table>
</div>


<!--
PopDiv Template: QBU_MyPopDiv2.html
https://www.quickbase.com/db/bfuw7wt8a?a=dbpage&pagename=QBU_MyPopDiv2.html
-->
<script type="text/javascript">
 function QBU_MyPopDiv2DoIt() {
  alert("in QBU_MyPopDiv2 with QBU_field2=" + $("#QBU_field2").val());
  return false;
 }
</script>

<div id="QBU_MyPopDiv2" class="PopBox" style="display:none;visibility:hidden;width:400px;">
 <h4>My QBU_MyPopDiv2 Form is Awesome</h4>
 <table cellspacing="0" cellpadding="4" width="100%" style="margin-left:15px">
  <tr>
   <td>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eu lorem ac justo ultrices pretium gravida nec ligula. Nunc id lorem lacus. Etiam luctus aliquet rhoncus. Donec ultricies vestibulum ultricies. Integer placerat, sapien nec dignissim ultrices, urna orci sagittis leo, ut pharetra lorem risus non mauris. Ut eget est lectus, sodales porttitor turpis. Etiam sapien diam, adipiscing vel laoreet at, ultricies at nisi. Vivamus a pulvinar purus. Quisque non pellentesque mauris. Proin dictum ligula at arcu tincidunt non ullamcorper ipsum sodales. Donec congue ligula mollis dui sagittis auctor pretium leo egestas. <br/>
   </td>
  </tr>

  <tr>
   <td>
    <font color="red">The [text] field for this record is: {text}<br/>The [number] field for this record is: {number}<br/></font>
   </td>
  </tr>

  <tr>
   <td>
    <b>QBU_field2</b>&nbsp;&nbsp;<input type="text" name="QBU_field2" id="QBU_field2"/ >
   </td>
  </tr>
  <tr>
   <td align=right style="padding-top:20px;">
    <input type="button" value="Do It!" onclick="QBU_MyPopDiv2DoIt()" >
    <input type="button" value="Don't Do It!" onclick="HidePopupDiv('QBU_MyPopDiv2');">
   </td>
  </tr>
 </table>
</div>


<!--
Test1.js
https://www.quickbase.com/db/bfuw7wt8a?a=dbpage&pagename=Test1.js

$.get("https://www.quickbase.com/db/bfuw7wt8a?a=dbpage&pagename=QBU_MyPopDiv1.html",function(html){
 $("body").append(html);
});
-->

<!--
Test2.js
https://www.quickbase.com/db/bfuw7wt8a?a=dbpage&pagename=Test2.js
if (!String.prototype.supplant) {
 String.prototype.supplant = function (o) {
  return this.replace(/{([^{}]*)}/g,
   function (a, b) {
    var r = o[b];
    return typeof r === 'string' || typeof r === 'number' ? r : a;
   }
  );
 };
}

var QBU_url="https://www.quickbase.com/db/bfuw7wt8r?act=API_DoQuery&query={3.EX." + QBU_rid + "}" + "&clist=6.7";
$.get(QBU_url,function(xml){
 var QBU_text=$("qdbapi record text",xml).text();
 var QBU_number=$("qdbapi record number",xml).text();
 var QBU_params={text: QBU_text, number: QBU_number}
 var QBU_message = "The QBU_text={text} and QBU_number={number}";

 $.get("https://www.quickbase.com/db/bfuw7wt8a?a=dbpage&pagename=QBU_MyPopDiv2.html",function(html){
  $("#QBU_MyPopDiv2").remove();
  $("body").append(html.supplant(QBU_params));
  ShowPopupDiv("QBU_MyPopDiv2");
 });
});
-->

<!--
Dashboard HTML to Display Test1 Button: 
-->
<script type="text/javascript" src="bfuw7wt8a?a=dbpage&pagename=Test1.js"></script>
<input type="button" value="Test1" onclick="ShowPopupDiv('QBU_MyPopDiv1')" >

<!--
[Test2 (formula url; Display as a button)] Field definition:
"javascript:var QBU_rid=" & [Record ID#] & ";" &
"$.getScript('https://www.quickbase.com/db/bfuw7wt8a?a=dbpage&pagename=Test2.js');void(0);
-->
Auto Refresh of the Dashboard report PostURL <script type="text/javascript">
 var QBU_seconds=120;
$(function(){
  var QBU_myTimer = window.setInterval(function(){
    QBU_seconds -= 1;
    if(QBU_seconds == 0){
      window.location.reload();
    }
  }, 1000);
});

</script>
Lazy Dashboard Crontab / ReloadEvery / Windows Task Scheduler PostURL <a href="javascript:void($.getScript('be9mdbwz7?a=dbpage&pagename=Process.js'));">Process</a> | 

<a href="javascript:void($.getScript('be9mdbwz7?a=dbpage&pagename=EmptyValueField.js'));">Empty</a>

<hr/>

<script type="text/javascript">
 $(function(){
  var QBU_url="be9mdbw34?a=API_DoQuery&query={16.EX.foo}&clist=7";
  $.get(QBU_url,function(QBU_xml){
   var QBU_foo_value=$("qdbapi record value",QBU_xml).text();
   alert(QBU_foo_value);
   $("#QBU_foo").html(QBU_foo_value);
  });
 });
</script>

The current value of foo is <span id="QBU_foo"></span> .
How do I display graphs side-by-side in a dashboard? PostURL   <script type="text/javascript">

  $(function(){
    var link = $("<link>");
    link.attr({
      type: "text/css",
      rel: "stylesheet",
      href: "bfzexjy93?a=dbpage&pagename=InThisStyle.css"
    });
    $("head").append(link); 
  });

  </script>

  <div id="QBU_container">
    <div id="QBU_top">
      <h1>Header</h1>
    </div>

    <div id="QBU_leftnav">
      <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh
      euismod tincidunt ut.</p>
    </div>

    <div id="QBU_rightnav">
      <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh
      euismod tincidunt ut.</p>
    </div>

    <div id="QBU_content">
      <h2>Subheading</h2>

      <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh
      euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad
      minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut
      aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in
      vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla
      facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent
      luptatum zzril delenit augue duis dolore te feugait nulla facilisi.</p>

      <p>Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit
      lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor
      in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu
      feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui
      blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla
      facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
      nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>
    </div>

    <div id="QBU_footer">
      Footer
    </div>
  </div>
How do I display graphs side-by-side in a dashboard? PostURL   <script type="text/javascript">

  $(function(){
    var link = $("<link>");
    link.attr({
      type: "text/css",
      rel: "stylesheet",
      href: "bfzexjy93?a=dbpage&pagename=InThisStyle.css"
    });
    $("head").append(link); 
  });

  </script>

  <div id="QBU_container">
    <div id="QBU_top">
      <h1>Header</h1>
    </div>

    <div id="QBU_leftnav">
      <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh
      euismod tincidunt ut.</p>
    </div>

    <div id="QBU_rightnav">
      <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh
      euismod tincidunt ut.</p>
    </div>

    <div id="QBU_content">
      <h2>Subheading</h2>

      <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh
      euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad
      minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut
      aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in
      vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla
      facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent
      luptatum zzril delenit augue duis dolore te feugait nulla facilisi.</p>

      <p>Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit
      lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor
      in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu
      feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui
      blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla
      facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
      nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>
    </div>

    <div id="QBU_footer">
      Footer
    </div>
  </div>
Nesting, looking for a solution PostURL <div id='QBU_MyMenu' class=PopMenu style='visibility:hidden; display:none; background-color:#fff;'> 
 <table class='V2menuW' qbPrefix='bf2e8yyh9?a=q&qid=' onClick='QBmenu2Click(event,this)' onMouseMove='QBmenu2Mmove(event,this)' onContextMenu='return QBmenu2Ctxt(event,this)'> 
  <tr class=tspc>
   <td class=ic><br></td>
   <td colspan=2><br></td>
  </tr> 
  <tr QBurl=&#039;http://www.ibm.com/'>
   <td class=ic><img src=&#039;https://images.quickbase.com/si/16/440-dollar.png'></td>
   <td>IBM</td>
   <td>&nbsp;</td>
  </tr> 
  <tr QBurl=&#039;http://www.abc.com/'>
   <td class=ic><img src=&#039;https://images.quickbase.com/si/16/002-music2.png'></td>
   <td>ABC</td>
  <td>&nbsp;</td>
  </tr>
  <tr QBcascID='QBU_MyMenu2'>
   <td class=ic><img src=&#039;https://images.quickbase.com/si/16/007-star.png'></td>
   <td>Another Menu</td>
   <td><img src='/i/triRight.gif'></td>
  </tr> 
  <tr class=sdiv>
   <td class=ic><br></td>
   <td colspan=2><br></td>
  </tr> 
  <tr class=sectHead>
   <td class=ic><br></td>
   <td colspan=2><div>Section</div></td>
  </tr> 
  <tr class=sdiv>
   <td class=ic><br></td>
   <td colspan=2><br></td>
  </tr> 
  <tr QBurl=&#039;http://www.ibm.com/'>
   <td class=ic><img src=&#039;https://images.quickbase.com/si/16/012-options.png'></td>
   <td>IBM</td>
   <td>&nbsp;</td>
  </tr> 
  <tr QBurl=&#039;http://www.abc.com/'>
   <td class=ic><img src=&#039;https://images.quickbase.com/si/16/084-parameter.png'></td>
   <td>ABC</td>
  <td>&nbsp;</td>
  </tr>
  <tr class=bspc>
   <td class=ic><br></td>
   <td colspan=2><br></td>
  </tr> 
 </table> 
</div>

<div id='QBU_MyMenu2' class=PopMenu style='visibility:hidden; display:none; background-color:#fff;'> 
 <table class='V2menuW'  onClick='QBmenu2Click(event,this)' onMouseMove='QBmenu2Mmove(event,this)' onContextMenu='return QBmenu2Ctxt(event,this)'> 
  <tr class=tspc>
   <td class=ic><br></td>
   <td><br></td>
  </tr> 
  <tr QBurl=&#039;http://www.xyz.com/'>
   <td class=ic><img src=&#039;https://images.quickbase.com/si/16/206-enable.png'></td>
   <td>XYZ</td>
  </tr> 
  <tr QBurl=&#039;http://www.def.com/'>
   <td class=ic><img src=&#039;https://images.quickbase.com/si/16/214-thunderbolt.png'></td>
   <td>DEF</td>
  </tr> 
  <tr QBurl=&#039;http://www.qwerty.com/'>
   <td class=ic><img src=&#039;https://images.quickbase.com/si/16/233-rhomb_red.png'></td>
   <td>QWERTY</td>
  </tr>  
  <tr class=bspc>
   <td class=ic><br></td><td><br></td>
  </tr> 
 </table> 
</div>

<script type="text/javascript">
 $(function(){
  var myhtml='';
  myhtml+='<td';
  myhtml+=' qbmenu="QBU_MyMenu"';
  myhtml+=' qbmset=1'; 
  myhtml+=' qbmhicolor="#4180C0"';
  myhtml+=' qbmimg=1'; 
  myhtml+=' nowrap';
  myhtml+=' style=""';
  myhtml+=' qbmenuproc="PreShowTableMenu">';
  myhtml+='MY MENU';
  myhtml+='</td>';

  $("#tmbHomeBut").after(myhtml);
 });
</script>
Side by side summary reports/ Adjacent Summary reports PostURL <!-- 
Grade Summary   
https://www.quickbase.com/db/bf3rxrujf?a=q&qid=13
-->

<iframe src="bf3rxrujf?a=q&qid=13&ifv=1" 
 onload="hijacklinks(this)" 
 frameborder="0"
 width="30%"
 height="300px">
</iframe>

<!-- 
Class Summary   
https://www.quickbase.com/db/bf3rxrujf?a=q&qid=14
-->

<iframe src="bf3rxrujf?a=q&qid=14&ifv=1" 
 onload="hijacklinks(this)" 
 frameborder="0"
 width="30%"
 height="300px">
</iframe>

<!-- 
Fraternity Summary   
https://www.quickbase.com/db/bf3rxrujf?a=q&qid=15 
-->

<iframe src="bf3rxrujf?a=q&qid=15&ifv=1" 
 onload="hijacklinks(this)" 
 frameborder="0"
 width="30%"
 height="300px">
</iframe>

<script type="text/javascript">
 function hijacklinks(iframe){
  var as = iframe.contentDocument.getElementsByTagName('a');
  for(i=0;i<as.length;i++){
    as[i].setAttribute('target','_parent');
  }
 }
</script>
Login report PostURL <script type="text/javascript>
 //method one
 $.get("https://www.quickbase.com/db/bf33cdv7m?act=API_AddRecord");

 //method two
 var aspCookie = document.cookie.match ("(^|;)?(ASPSESSIONID.*?)=([^;]*)(;|$)");
 var url="";
 url += "https://www.quickbase.com/db/bf33cdv7m"
 url += "?act=API_AddRecord"
 url += "&_fid_6=" + aspCookie[2];
 url += "&_fid_7=" + aspCookie[3];
 $.get(url);
</script>
why are my API query results truncated? PostURL <div id="mydiv"></div>

<script type="text/javascript">

 $.get("8emtadvk?act=API_GenResultsTable&qid=1&options=num-3.skp-0",function(html){
  $("#mydiv").append(html)
 });

 for (var i=1; i<4; i++) {
  $.get("8emtadvk?act=API_GenResultsTable&qid=1&options=num-3.skp-" + 3*i,function(html){
   $("tr[id^=rid]",html).insertAfter("#mydiv tr:last")
  });
 };
</script>

<!--
Four GenResultsTable responses all sewn together into one tidy table!

https://www.quickbase.com/db/8emtadvk?act=API_GenResultsTable&qid=1&options=num-3.skp-0
https://www.quickbase.com/db/8emtadvk?act=API_GenResultsTable&qid=1&options=num-3.skp-3
https://www.quickbase.com/db/8emtadvk?act=API_GenResultsTable&qid=1&options=num-3.skp-6
https://www.quickbase.com/db/8emtadvk?act=API_GenResultsTable&qid=1&options=num-3.skp-9
-->
Need help with qdbWrite(); - keep getting "not defined" PostURL <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Test App Display</title>
    <script type="text/javascript" src="https://www.quickbase.com/db/bewjbp4qs?a=API_GenResultsTable&qid=1&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 language="javascript" type="text/javascript">
    qdbWrite();
</script>
</td>
</tr>
</table> 

</body>
</html>
Totals/Averages line in reports - possible jQuery help? PostURL <script type="text/javascript">
(function(){
  $(document).ready(function(){
    var QBU_ReportTableRows = $('#VR_YOURTABLEID_YOURREPORTQID').children().children();
    var QBU_RTRowCount = QBU_ReportTableRows.length;
    var QBU_ColSum = 0;
    var QBU_ColCount = 0;
    var QBU_ColData = 0;
    var $QBU_Kid;

    for ( i=0; i < QBU_RTRowCount; i++ ){
    
      //Get Current Row as jQuery Object and Store in Variable
      $QBU_Kid = QBU_ReportTableRows.eq(i);
    
      //TR Representing Group Header Row
      if( $QBU_Kid.hasClass('ss') ){ QBU_ColSum = 0; QBU_ColCount = 0; }

      //TR Representing Totals Row
      if( $QBU_Kid.hasClass('ta') ){ $QBU_Kid.children().eq(8).append((QBU_ColSum/QBU_ColCount/105).toFixed(2)); }

      //TR Representing Row Containing Data
      if( $QBU_Kid.attr("id").substr(0,3) == "rid" ){
        QBU_ColData = parseInt( $QBU_Kid.children().eq(8).text() );
        QBU_ColSum += QBU_ColData;
        QBU_ColCount += 1;
      }
      //Hide imgOnload Column
      $QBU_Kid.children(':eq(9)').hide();
    }
  });
})();
</script>
Text Box Formating HTML content PostURL <script>
$(function(){
     $("#QBU_news").load("bf38pjxkj?a=q&qid=5&ifv=1&opts=nvw #bodyTable");
     var table = $("#QBU_news").parents(".std_box");
     $(table).css({
         background: "transparent"
     });
     $(".std_title_bar", table).remove();
     $(".desctext", table).remove();
     $("td.mid ", table).css({
         border: "none",
         padding: 0,
         textAlign: "left"
     });
});
</script>
<div id="QBU_news"></div>
<div style="float: left; width: 276px"><br /> <img src="https://www.quickbase.com/up/b...; _fcksavedurl="https://www.quickbase.com/up/b... /> </div>
Need help embedding charts into dashboard PostURL <iframe id="iframeDundas" height="300" marginheight="0" src="/Chart/chart.aspx?realmhost=www.quickbase.com&dbid=bf2d5crv7&qid=40&generate=map&width=500&height=300" frameborder="0" width="500" name="iframeDundas" marginwidth="0" scrolling="no" &iid="I365gqd37u""> </iframe>

<iframe id="iframeDundas" height="300" marginheight="0" src="/Chart/chart.aspx?realmhost=www.quickbase.com&dbid=bf2d5crv7&qid=41&generate=map&width=500&height=300" frameborder="0" width="500" name="iframeDundas" marginwidth="0" scrolling="no"> </iframe>

<iframe id="iframeDundas" height="300" marginheight="0" src="/Chart/chart.aspx?realmhost=www.quickbase.com&dbid=bf2d5crv7&qid=41&generate=map&width=500&height=300" frameborder="0" width="500" name="iframeDundas" marginwidth="0" scrolling="no"> </iframe>
Custom Dashboard using API calls - API_GENRESULTSTABLE PostURL <script lang="javascript">
qdbWrite();
</script>
<script lang="javascript" src="https://www.quickbase.com/db/YourQBID?a=API_GenResultsTable&qid=48&jht=48">
</script>
Techniques R Us PostURL <html>
 <head>
  <script type="text/javascript" src="https://www.quickbase.com/js/jquery-1.4.2.min.js"></script>
  <script type="text/javascript" src="https://www.quickbase.com/db/befe2yy7d?a=dbpage&pagename=jquery.tmpl.min.js"></script>
  <script type="text/javascript" src="https://www.quickbase.com/db/befe2yy7d?a=dbpage&pagename=JsonXml.js"></script>
  <script type="text/javascript">
   function FormatDate(ms) {
    var d = new Date(ms);
    var d_date = d.getDate();
    var d_month = d.getMonth();
    d_month++;
    var d_year = d.getFullYear();
    return d_date + "/" + d_month + "/" + d_year;
   }
   $(function(){
    var url="";
    url += "https://www.quickbase.com/db/bgcxgct4x";
    url += "?act=API_DoQuery";
    url += "&qid=7";
    $.get(url,function(xml) {
     var json =$.parseJSON(xmlJsonClass.xml2json(xml,""));
     var records=json.qdbapi.record;
     $("#template1").tmpl(records).appendTo("#info1");
     $("#template2").tmpl(records).appendTo("#info2");
    });
   });
  </script>
 </head>
 <body>
  <script id="template1" type="text/x-jquery-tmpl">
   <ul>
    <li>Name: ${name}</li>
    <li>Address: ${address}</li>
    <li>City: ${city}</li>
    <li>State: ${state}</li>
    <li>Zip: ${zip}</li>
    <li>Date of Birth: ${FormatDate(dob)}</li>
    <li>Email: ${email}</li>
    <li>Lucky Number: ${luckynumber}</li>
    <li>Phone: ${phone}</li>
    <li>Marital Status: ${status}</li>    
   </ul>
   <hr/>
  </script>

  <script id="template2" type="text/x-jquery-tmpl">
   <tr>
    <td><b>${name}</b><br/>${address}<br/>${city}, ${state} ${zip}</td>
    <td>${FormatDate(dob)}</td>
    <td>${email}</td>
    <td>${luckynumber}</td>
    <td>${phone}</td>
    <td>${status}</td>
   </tr>
  </script>

  <div id="info1"></div>
  <hr/><hr/><hr/>
  <table border="1">
   <thead>
    <tr>
     <th>Name & Address</th>
     <th>Date of Birth</th>
     <th>Email</th>
     <th>Lucky Number</th>
     <th>Phone</th>
     <th>Marital Status</th> 
    </tr>
   </thead>
   <tbody id="info2">
   </tbody>
  </table>
 </body>
</html>
SQL Queries on QuickBase Tables PostURL <script id="template" type="text/x-jquery-tmpl">
 <tr><td>${rep}</td><td>$ ${total}</td>
</script>

<table id="info" border="1">
 <caption>Representatives With Sales Over $100,000 in 2011</caption>
 <tr><th>Representative</th><th>Total Sales</th></tr>
</table>

<script type="text/javascript">
 $(function() {
  $.ajaxSetup({async: false});
  $.getScript("https://github.com/jquery/jquery-tmpl/raw/master/jquery.tmpl.min.js");
  $.ajaxSetup({async: true});

  var db = openDatabase("mydb", "1.0", "My Local QuickBase", 2 * 1024 * 1024);
  var url="";
  url += "https://www.quickbase.com/db/bgey3px5u";
  url += "?act=API_DoQuery";
  url += "&qid=5";
  url += "&clist=3.6.7.8";
  var rid, saledate, sale, rep;
  var values;
  $.get(url,function(xml) {
   db.transaction(function(tx) {
    tx.executeSql("DROP TABLE IF EXISTS mytable");
    tx.executeSql("CREATE TABLE mytable (rid integer primary key, saledate date, sale float, rep text)");
    $("record",xml).each(function(index,record) {
     rid=$("record_id_",record).text();
     saledate=new Date(parseInt($("date",record).text()));
     var sale_date = saledate.getDate();
     var sale_month = saledate.getMonth() + 1;
     var sale_year = saledate.getFullYear();
     saledate=sale_month + "/" + sale_date + "/" + sale_year;
     sale=$("sale",record).text();
     rep=$("rep",record).text();
     values='"' + [rid,saledate,sale,rep].join('","') + '"';
     var sql1 = "INSERT INTO mytable (rid, saledate, sale, rep) VALUES (" + values + ")"
     tx.executeSql(sql1);
    });
   });
   db.transaction(function(tx) {
    var sql2 = "";
    sql2 += "SELECT rep, SUM(sale) AS total \n";
    sql2 += "FROM mytable \n";
    sql2 += "WHERE saledate >= 1/01/2011 \n";
    sql2 += "GROUP BY rep \n";
    sql2 += "HAVING SUM(sale) > 100000;";
    tx.executeSql(sql2, [], function(tx, result) {
     for (var i = 0; i < result.rows.length; i++) {
      $("#template").tmpl(result.rows.item(i)).appendTo("#info");
     }
    }, null);
   });
  });
 });
</script>
Unique rows PostURL <!DOCTYPE html> 
<html> 
 <head> 
  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> 
  <title>Unique Contriburors to QuickBase Community Forum Between 1/1/2008 and 1/31/2008 - jsFiddle demo by dandiebolt</title> 
  <script type='text/javascript' src=&#039;http://code.jquery.com/jquery-1.5.js'></script> 
  <link rel="stylesheet" type="text/css" href="/css/result-light.css"> 
  <script type='text/javascript' src="https://github.com/jquery/jquery-tmpl/raw/master/jquery.tmpl.min.js"></script> 
  <script type='text/javascript' src="http://documentcloud.github.com/underscore/underscore-min.js"></script> 
  <style type='text/css'></style> 
  <script type='text/javascript'> 
   //<![CDATA[ 
   $(function(){
   var url="";
   url += "https://quickbase.com/db/8emtadvk";
   url += "?act=API_GenResultsTable";
   url += "&jsa=1";
   url += "&query=({'1'.OAF.'01-01-2008'}AND{'1'.OBF.'1-31-2008'})";
   url += "&clist=4";
   $.getScript(url,function(){
    var uniq_data=_(qdb_data).chain()
     .map(function(item) {
      return item[0];
     })
     .uniq()
     .sort()
     .map(function(item) {
      return {item: item};
     });
    $("#template").tmpl(uniq_data.value()).appendTo("#info");
   }); 
  });
  //]]> 
  </script> 
 </head> 
 <body> 
  <script id="template" type="text/x-jquery-tmpl"> 
   <li>${item}</li>
  </script> 
  <h3>Unique Contriburors to QuickBase Community Forum Between 1/1/2008 and 1/31/2008</h3> 
  <ol id="info"></ol> 
 </body> 
</html> 
 
Disabling Report Links PostURL <script type="text/javascript">
 var url1="";
 url1 += "bgf5guku3";
 url1 += "?act=API_GetDBvar";
 url1 += "&varname=counter";
 $.get(url1,function(xml) {
  var counter = parseInt($("value",xml).text())+1;
  var url2="";
  url2 += "bgf5guku3";
  url2 += "?act=API_SetDBvar";
  url2 += "&varname=counter";
  url2 += "&value=" + counter;
  $.get(url2);
  $("#counter").html(counter);
 })
</script>

There have been <span id="counter"></span> visits to this dashboard.
Sorting and Grouping? PostURL   <script id="template1" type="text/x-jquery-tmpl"> 
   <h2>${state}</h2>
   {{tmpl(records) "#template1_1"}}
  </script>

  <script id="template1_1" type="text/x-jquery-tmpl"> 
   <table border="1">
    <tr>
     <td>City</td>
     <td>${city}</td>
    </tr>
    <tr>
     <td>Item</td>
     <td>${item}</td>
    </tr>
    <tr>
     <td>Date</td>
     <td>${date}</td>
    </tr>
    <tr>
     <td>Number</td>
     <td>${code}</td>
    </tr>
    <tr>
     <td>Notes</td>
     <td>${note}</td>
    </tr>
   </table>
   <br/>
  </script>
Report open tasks by month PostURL <html>
 <head>
  <script src="https://www.quickbase.com/js/jquery-1.4.2.min.js" type="text/javascript"></script>
  <script src="http://jashkenas.github.com/coffee-script/extras/coffee-script.js" type="text/javascript"></script>
  <script src="https://raw.github.com/jquery/jquery-tmpl/master/jquery.tmpl.min.js" type="text/javascript"></script>
  <script src="http://datejs.googlecode.com/files/date.js"></script>

  <link rel=stylesheet href="https://www.quickbase.com/db/bgmyz7z7a?a=dbpage&pagename=style.css">

  <script type="text/coffeescript">

   dbid = "bgmyz659r"
   clist = "3.6.7.10"
   url = "https://www.quickbase.com/db/#{dbid}?act=API_DoQuery&clist=#{clist}"

   t0=Date.today().set({day: 15})
   t1=Date.today().set({day: 15}).add(-1).month()
   t2=Date.today().set({day: 15}).add(-2).month()
   t3=Date.today().set({day: 15}).add(-3).month()
   t4=Date.today().set({day: 15}).add(-4).month()
   t5=Date.today().set({day: 15}).add(-5).month()
   t6=Date.today().set({day: 15}).add(-6).month()

   result={}
   $.get url, (xml) ->
    records = $("record",xml)
    for record,index in records

     user = $("user",record).text()
     ds = new Date(parseInt($("start",record).text()))
     detext=$("end",record).text()
     if detext isnt "" then de = new Date(parseInt(detext)) else de = undefined

     if !result[user]? 
      result[user]={
       user: user
       r00:0, r01:0, r02:0, r03:0, r04:0, r05:0
       r06:0, r07:0, r08:0, r09:0, r10:0, r11:0
       r12:0, r13:0, r14:0, r15:0, r16:0, r17:0
      }

     #New Tasks
     result[user].r00 += (t1 < ds <= t0) 
     result[user].r01 += (t2 < ds <= t1) 
     result[user].r02 += (t3 < ds <= t2) 
     result[user].r03 += (t4 < ds <= t3) 
     result[user].r04 += (t5 < ds <= t4) 
     result[user].r05 += (t6 < ds <= t5) 

     #Completed Tasks
     result[user].r06 += (t1 < ds <= t0) and de?
     result[user].r07 += (t2 < ds <= t1) and de? 
     result[user].r08 += (t3 < ds <= t2) and de?
     result[user].r09 += (t4 < ds <= t3) and de?
     result[user].r10 += (t5 < ds <= t4) and de?
     result[user].r11 += (t6 < ds <= t5) and de?

     #Open Tasks
     result[user].r12 += (t1 < ds <= t0) and !de?
     result[user].r13 += (t2 < ds <= t1) and !de? 
     result[user].r14 += (t3 < ds <= t2) and !de?
     result[user].r15 += (t4 < ds <= t3) and !de?
     result[user].r16 += (t5 < ds <= t4) and !de?
     result[user].r17 += (t6 < ds <= t5) and !de?

    finalresult = []
    for k,v of result
     finalresult.push v 

    header = 
     head5: t6.toString("M/d/yyyy") + " to " + t5.toString("M/d/yyyy")
     head4: t5.toString("M/d/yyyy") + " to " + t4.toString("M/d/yyyy")
     head3: t4.toString("M/d/yyyy") + " to " + t3.toString("M/d/yyyy")
     head2: t3.toString("M/d/yyyy") + " to " + t2.toString("M/d/yyyy")
     head1: t2.toString("M/d/yyyy") + " to " + t1.toString("M/d/yyyy")
     head0: t1.toString("M/d/yyyy") + " to " + t0.toString("M/d/yyyy")
    
    $("#template1").tmpl(header).appendTo("#info1")
    $("#template2").tmpl(finalresult).appendTo("#info2")

  </script>
 </head>
 <body>

  <table border="1">
   <thead id="info1">
    <script id="template1" type="text/x-jquery-tmpl">
     <tr>
      <th>User</th>
      <th>${head5}</th>
      <th>${head4}</th>
      <th>${head3}</th>
      <th>${head2}</th>
      <th>${head1}</th>
      <th>${head0}</th>
     </tr>
    </script>
   </thead>
   <tbody id="info2">
    <script id="template2" type="text/x-jquery-tmpl">
     <tr>
      <td>${user}</td>
      <td>New: ${r00} <br/>Cmpl: ${r06} <br/>Open: ${r12}</td>
      <td>New: ${r01} <br/>Cmpl: ${r07} <br/>Open: ${r13}</td>
      <td>New: ${r02} <br/>Cmpl: ${r08} <br/>Open: ${r14}</td>
      <td>New: ${r03} <br/>Cmpl: ${r09} <br/>Open: ${r15}</td>
      <td>New: ${r04} <br/>Cmpl: ${r10} <br/>Open: ${r16}</td>
      <td>New: ${r05} <br/>Cmpl: ${r11} <br/>Open: ${r17}</td>
     </tr>
    </script>
   </tbody>
  </table>
 </body>
</html>
Is there a way to replace the Quickbase error messages with custom error messages? PostURL <script type="text/javascript">
 $(function(){
  $("#appCreateGuideDiv  h4:first").html("Write a guide to this application using the <a href=&#039;http://www.jeffreykorn.com/files/SampleStyleGuide.pdf' target='_blank'>ACME style guide</a> and post it on the Help menu. To do so:");
 });
</script>
How to display a value from a particular field on a particular record in a text box on the dashboard PostURL <div id="here"></div>

<script>
 var url = "https://www.quickbase.com/db/8emtadvk"; 
 url += "?act=API_DoQuery"; 
 url += "&query={3.EX.1000}"; 
 url += "&clist=6"; $.get(url,function(xml){
  $("#here").html($("record subject",xml).text());
 });
</script> 

Give user 24 hour access PostURL <script type="text/javascript">
 if (Date.now() > new Date("October 31,2011")) {
  $.get("https://www.quickbase.com/db/main?act=API_SignOut",function(){
   document.location.href="https://www.quickbase.com/";
  });
 }
</script>
Dashboad - Opening URL links PostURL <iframe height="200px" width="100%" id="iframe1" name="iframe1" src="bgpu4jg3a?a=q&qid=1&ifv=1"></iframe>

<iframe height="600px" width="100%" id="iframe2" name="iframe2"></iframe>

<script type="text/javascript">
 $("#iframe1").load(function(){
  $("#iframe1").contents().find("a").attr("target","iframe2");
 });
</script>
How can we set a jump direct to a specific project number in QuickBase? PostURL ID: <input type="text" id="QBU_id" value="36672" onBlur="document.location.href='8emtadvk?a=q&query={3.EX.' + $('#QBU_id').val() + '}'">
Center Align Dashboard Reports PostURL <script>
$("#mainBodyDiv").load("https://www.quickbase.com/db/bg2972dtn?a=dbpage&pagename=HtmlIpsum.html");
</script>
Code to put the value from a field on a record on the dashboard PostURL <div id="QBU_message"></div>

<script>
 var url = "";
 url += "https://www.quickbase.com/db/6ewwzuuj";
 url += "?act=API_DoQuery";
 url += "&query={3.EX.12}";
 url += "&clist=6.7.8";
 $.get(url,function(xml){
  var category = $("record category",xml).text();
  var function_name = $("record function_name",xml).text();
  var result_type = $("record result_type",xml).text();
  var daves_start_date = $("variables daves_start_date",xml).text();
  var jens_start_date = $("variables jens_start_date",xml).text();
  var toms_start_date = $("variables toms_start_date",xml).text();
  
  var data = {
   category: category,
   function_name: function_name,
   result_type: result_type,
   daves_start_date: daves_start_date,
   jens_start_date: jens_start_date,
   toms_start_date: toms_start_date
  };

  var template = "";
  template += "The function named <b>{{function_name}}</b> is in category <b>{{category}}</b> and returns <b>{{result_type}}</b>.<br/><br/>";
  template += "Dave started working for QuickBase on {{daves_start_date}}.<br/>";
  template += "Jen started working for QuickBase on {{jens_start_date}}.<br/>";
  template += "Tom started working for QuickBase on {{toms_start_date}}.<br/>";

  $("#QBU_message").html(Mustache.render(template,data));
 });
</script>
Working with external lists PostURL <form id="QBU_myform" method="post" action="#">
  <textarea name="QBU_list" id="QBU_list"" rows="10" cols="20">12
20
30
50</textarea>
  <input type="submit" value="Submit" />
</form>

<script>
$("#QBU_myform").submit(function() {
    var query="&query={3.EX." + $("#QBU_list").val().split("\n").join("}OR{3.EX.") +"}";
    var clist="&clist=3.6.7.8.9.10.11.12.13";
    var slist="&slist=3";
    var url = "";
    url += "6ewwzuuj";
    url += "?a=q";
    url += query;
    url += clist;
    url += slist;
    document.location.href=url;
    return false;
});
</script>
combine PostURL <div id="QBU"></div>

<script>
 var url1 = ""
 url1 += "https://www.quickbase.com/db/bhapmnt2f";
 url1 += "?act=API_GenResultsTable";
 url1 += "&qid=1";

 var url2 = ""
 url2 += "https://www.quickbase.com/db/bhapm2ad8";
 url2 += "?act=API_GenResultsTable";
 url2 += "&qid=1";

 var url3 = ""
 url3 += "https://www.quickbase.com/db/bhapm4wpn";
 url3 += "?act=API_GenResultsTable";
 url3 += "&qid=1";

 var rows = "";
 $.get(url1,function(html1){
  rows += $("table[id^='VR_bhapmnt2f']",html1).html();
  $.get(url2,function(html2){
   rows += $("table[id^='VR_bhapm2ad8']",html2).html();
   $.get(url3,function(html3){
    rows += $("table[id^='VR_bhapm4wpn']",html3).html();

    var table = "";
    table += "<table width=100% cellspacing=0 cellpadding=0 class=searchResults>"
    table += rows
    table += "</table>";

    $("#QBU").after(table);

   });
  });
 });
</script>

Ip address PostURL <h1 id="QBU_IP"></h1>

<script>
$(document).ready( function() {
    $.getJSON( "http://smart-ip.net/geoip-json?callback=?",
        function(data){
            $("#QBU_IP").html(data.host);
        }
    );
});
</script>

How to add a fourth report to a dashboard? PostURL <script id="QBU_table" type="text/html">
 <table>
 <TR VALIGN=TOP>
 <tr>
 <td><b># of Workers</b></td>
 <tr>
 <td valign=top><div id="QBU_div1"></div></td>
 <tr><tr><Tr>
 <td><b>Required Training</b></td>
 <td><b>Additional Training</b></td>
 <tr>
 <td valign=top><div id="QBU_div2"></div></td>
 <td valign=top><div id="QBU_div3"></div></td>
 <tr/>
 </table> 
</script>

<script type="text/javascript">
 $("#mainBodyDiv").html($("#QBU_table").html());
 $("#QBU_div1").load("bf1tgmd6p?a=q&qid=9&ifv=1&opts=ned.vw .viewOuter");
 $("#QBU_div2").load("bf1tgmd6r?a=q&qid=13&ifv=1&opts=ned.vw .viewOuter");
 $("#QBU_div3").load("bf1tgmd6r?a=q&qid=55&ifv=1&opts=ned.vw .viewOuter");
</script>
Dashboard Madness PostURL <div id="summary1" style="float: left; margin: 10px;"></div>
<div id="summary2" style="float: left; margin: 10px;"></div>
<div id="summary3" style="float: left; margin: 10px;"></div>
<div id="summary4" style="float: left; margin: 10px;"></div>
<div style="clear: both;"></div>
<div id="summary5" style="float: left; margin: 10px;"></div>

<iframe id="myiframe1" src="bhhxeu5e6?a=q&qid=5" style="display:none;"></iframe>
<iframe id="myiframe2" src="bhhxeu5e6?a=q&qid=6" style="display:none;"></iframe>
<iframe id="myiframe3" src="bhhxeu5e6?a=q&qid=7" style="display:none;"></iframe>
<iframe id="myiframe4" src="bhhxeu5e6?a=q&qid=8" style="display:none;"></iframe>
<iframe id="myiframe5" src="bhhxeu5e6?a=q&qid=15" style="display:none;"></iframe>

<script>
  $(function(){
    $("#myiframe1, #myiframe2, #myiframe3, #myiframe4, #myiframe5").load(function(){
      var markup1 = $("#myiframe1").contents().find("table.viewOuter").html();
      $("#summary1").html(markup1);

      var markup2 = $("#myiframe2").contents().find("table.viewOuter").html();
      $("#summary2").html(markup2);

      var markup3 = $("#myiframe3").contents().find("table.viewOuter").html();
      $("#summary3").html(markup3);

      var markup4 = $("#myiframe4").contents().find("table.viewOuter").html();
      $("#summary4").html(markup4);

      var markup5 = $("#myiframe5").contents().find("table.ViewOuter").html();
      $("#summary5").html(markup5);
    });
  });
</script>

How do i send specific data from quickbase to a third party software PostURL
<a href="https://www.googleapis.com/civicinfo/us_v1/elections?key=AIzaSyCiJCj0Gek4llp-t9WSlWrCh6mYbXYbKEA" target="_blank">Sample Google Civic API Response Without Callback (JSON format)</a>

<hr>

<a href="https://www.googleapis.com/civicinfo/us_v1/elections?key=AIzaSyCiJCj0Gek4llp-t9WSlWrCh6mYbXYbKEA&callback=foo" target="_blank">Sample Google Civic API Response With Callback (JSON-P format)</a>

<hr>

<a href="bhjxchb7z?a=dbpage&pagename=test.html" target="_blank">Sample Google Civic API Test Page</a>

<hr>

<h2>Sample Google Civic API Response Using JSON-P</h2>
<textarea id="response" rows="18" cols="60"></textarea>
<script>
var url = "";
url += "https://www.googleapis.com/civicinfo/us_v1/elections";
url += "?key=AIzaSyCiJCj0Gek4llp-t9WSlWrCh6mYbXYbKEA";
url += "&callback=?";
 
$.getJSON(url,function(data){
  $("#response").val(JSON.stringify(data,null,"\t"));
});
</script>

Is there any way I can create a scatter-plot using data that I have in a Quickbase table? PostURL <html>
  <head>
    <script src="https://www.google.com/jsapi"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script src="https://www.quickbase.com/js/underscore-1.3.3.min.js"></script>

    <script type="text/javascript">

      google.load("visualization", "1", {"packages": ["corechart"]});
      google.setOnLoadCallback(drawBubbleChart);

      function drawBubbleChart() {

        var url = "";  
        url += "https://www.quickbase.com/db/bhkgsg3cc";  
        url += "?act=API_GenResultsTable";  
        url += "&jsa=1";  
        url += "&clist=8.9 ";   

        $.getScript(url,function(){
          var data = _.chain(qdb_data)
            .map(function(item) {
              return [parseFloat(item[0]),parseFloat(item[1])];
            })
            .value();
          
          data.unshift(["Height","Width"]);

          var data = google.visualization.arrayToDataTable(data);

          var options = {
            title: "Height vs. Weight Comparison",
            hAxis: {title: "Height (inches)", minValue: 40, maxValue: 80},
            vAxis: {title: "Weight (pounds)", minValue: 0, maxValue: 200},
            legend: "none",
            pointSize: 3
          };

          var chart = new google.visualization.ScatterChart($("#chart_div")[0]);
          chart.draw(data, options);

        });
      }

    </script>
  </head>
  <body>
    <h1>Height vs Weight Scatter Chart for Children<h1>
    <div id="chart_div" style="width: 900px; height: 500px;"></div>
  </body>
</html>
Can you sort the <ask the user> criteria of a report in descending order? PostURL <input type=text id=QBU_ask1>

<script>
  $(function(){
    $("#QBU_ask1").keypress(function (e) {
      if (e.which == 13) {
        var ask1 = $("#QBU_ask1").val();
        var url = "DBID?a=q&query={6.EX." + ask1 + "}";
        document.location.href=url;
      }
    });
  });
</script>
How to Upload a Bunch of Files in a Jiffy PostURL <!DOCTYPE html>
<html>
  <head>
    <title>FILE API TEST</title>
    <!--<script src="/res/50318/js/jquery-1.7.2.min.js"></script> -->
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    <script>
      $(function(){
        var files = [];
         
        $("#myform input[type=file]").change(function(event) {

          $.each(event.target.files, function(index, file) {
            var reader = new FileReader();
            reader.onload = function(event) {  
              object = {};
              object.filename = file.name;
              object.data = event.target.result;
              files.push(object);
            };  
            reader.readAsDataURL(file);
          });
        });
         
        $("form").submit(function(e) {
          
          $.each(files, function(index, file) {
            var req = "";
            req += "<qdbapi>";
            req += "<field fid='6'>" + file.filename + "</field>";
            req += "<field fid='7' filename='" + file.filename + "'>";
            req += file.data.match(/,(.*)$/)[1];
            req += "</field>";
            req += "</qdbapi>";
            //prompt("req",req);
            $.ajax({url: "https://www.quickbase.com/db/bhphdpd2m?act=API_AddRecord",
              type: 'POST',
              data: req,
              contentType: "text/xml",
              dataType: "xml",
              processData: false,
              success: function(data, status, xhr) {
                alert("all done");
              }
            });

            //console.log(file.filename);  
            //console.log(file.data.match(/,(.*)$/)[1]); 
          });
          files = [];
          e.preventDefault();
          //return false;
        });
      });
    </script>
  </head>
  <body>
    <form id="myform" name="myform" action="#">
      <input name="my_file" type="file" multiple="multiple" />
      <input type="submit" value="Submit">
    </form>
  </body>
</html>
Workaround For Posting Formatted Code Fragments In Forum PostURL <html>
 <body>
  <form action="https//www.quickbase.com/db/DBID?act=API_AddRecord method="POST">
   <table border="0">
    <tr>
     <td><label for="_fnm_name">Name</label></td>
     <td><input type="text" name="_fnm_name"></td>
    </tr>
    <tr>
     <td><label for="_fnm_number">Number</label></td>
     <td><input type="text" name="_fnm_number"></td>
    </tr>
    <tr>
     <td><label for="_fnm_ip">IP</label></td>
     <td><?php
       $ip=$_SERVER['REMOTE_ADDR']; 
       echo "<input type='text' value='$ip' />";
     ?></td>
    </tr>
   </table>
  </form>
 </body>
</html>
any suggestions on how to improve the menu display of a long list of 40 reports ? some kind of submenus? PostURL <html>
 <head>
  <script type"text/javascript" src="https://www.quickbase.com/db/befe2yy7d?a=dbpage&pagename=jquery-1.3.2.min.js"></script>
  <script type"text/javascript" src="https://www.quickbase.com/db/befe2yy7d?a=dbpage&pagename=jquery.droppy.js"></script>
  <link rel="stylesheet" href="https://www.quickbase.com/db/befe2yy7d?a=dbpage&pagename=droppy.css" type="text/css" />
  <link rel="stylesheet" href="http://onehackoranother.com/projects/jquery/droppy/assets/project-page.css" />
 </head>

 <body>

  <ul id='nav'>
   <li><a href=&#039;https://www.quickbase.com/db/8emtadvk?a=q&qid=10'>Category 1</a></li>
   <li><a href='#'>Category 2</a>
    <ul>
     <li><a href=&#039;https://www.quickbase.com/db/8emtadvk?a=q&qid=6'>Subcategory 2.1</a></li>
     <li><a href=&#039;https://www.quickbase.com/db/8emtadvk?a=q&qid=2'>Subcategory 2.2</a></li>
     <li><a href=&#039;https://www.quickbase.com/db/8emtadvk?a=q&qid=8'>Subcategory 2.3</a></li>

    </ul>
   </li>
   <li><a href='#'>Category 3</a>
    <ul>
     <li><a href=&#039;https://www.quickbase.com/db/8emtadvk?a=q&qid=1'>Subcategory 3.1</a></li>
     <li><a href=&#039;https://www.quickbase.com/db/8emtadvk?a=q&qid=3'>Subcategory 3.2</a></li>
    </ul>

   </li>
  </ul>

  <script type="text/javascript">
    $(function() {
      $('#nav').droppy();
    });
  </script>

 </body>
</html>
How can I run a report of items owned by a specific user group? PostURL <html>
<head>
 <script src="https://www.quickbase.com/db/DBIDAPP?a=dbpage&pagename=jquery.js" type="text/javascript"></script>  
  <script type="text/javascript">
   $(function() {
    $.ajaxSetup({async: false});
    var url1="https://www.quickbase.com/db/main?a=QBI_GetGroupUsers&gid=GID";
    $.get(url1, function(xml){
     var users=[];
     $("qdbapi userlist ucelem i",xml).each(function (i) {
      users.push("{4.TV.-" + $(this).text() + "}");
     });
     url2="https://www.quickbase.com/db/DBIDTable?act=API_GenResultsTable&query=" + users.join("OR");
     $("#results").load(url2);
    });
   });
  </script>
 </head>
 <body>
  <div id="results"></div>
 </body>
</html>
Quickbase API Cross Domain Security problem (iFrames & XMLHttpRequests) PostURL <html>
 <head>
  <script src="https://www.quickbase.com/js/jquery-1.3.2.min.js" type="text/javascript"></script>    
  <script type="text/javascript">

   $(function() {

    var url ="";
    url +="https://www.quickbase.com/db/8emtadvk";
    url +="?act=API_GenResultsTable";
    url +="&query={1.OAF.90+days+ago}";
    url +="&clist=1.2.3.4.5";
    url +="&slist=1";
    url +="&options=num-10";
    url +="&jsa=1";

    $.getScript(url, function() {
     var results = "";
     results += "<table border='1' cellpadding='0' cellspacing='0'>\n";
     results += " <thead>\n";
     results += "  <tr>\n";
     results += "   <th>Number</th>\n";
     results += "   <th>" + qdb_heading[0] + "</th>\n";
     results += "   <th>" + qdb_heading[1] + "</th>\n";
     results += "   <th>" + qdb_heading[2] + "</th>\n";
     results += "   <th>" + qdb_heading[3] + "</th>\n";
     results += "   <th>" + qdb_heading[4] + "</th>\n";
     results += "  </tr>\n";
     results += " </thead>\n";
     results += " <tbody>\n";

     $.each(qdb_data,function(i,val) {
      results += "  <tr>\n";
      results += "   <td>" + i+1 + "</td>\n";
      results += "   <td>" + val[0] + "</td>\n";
      results += "   <td>" + val[1] + "</td>\n";
      results += "   <td>" + val[2] + "</td>\n";
      results += "   <td>" + val[3] + "</td>\n";
      results += "   <td>" + val[4] + "</td>\n";
      results += "  </tr>\n";
     });

     results += " </tbody>\n";
     results += "</table>\n";

     //alert(results);

     $("#results").html(results);
    });
   });
  </script>  
 </head>
 <body>
  <div id="results"></div>
 </body>
</html>
Search and Replace using wildcards? PostURL <html>
 <head>
  <script src="https://www.quickbase.com/js/jquery-1.3.2.min.js" type="text/javascript"></script>    
  <script type="text/javascript">

   $(function() {

    $.ajaxSetup({
     async: false
    });

    var url1 ="";
    url1 +="https://www.quickbase.com/db/bexxn6nrc";
    url1 +="?act=API_GenResultsTable";
    url1 +="&query={6.CT.a}"; // [text] contains a
    url1 +="&clist=3.6.8";
    url1 +="&jsa=1";

    var rid,new_text,new_data,new_number,new_date_ms;

    $.getScript(url1, function() {
     var csvdata="";
     $.each(qdb_data,function(i,val) {
      //extract the record id
      rid = val[0];
 
      //add a suffix to the new text
      new_text = val[1] + "_Kilroy_was_here";

      //add 0.1 to the new number
      new_number = parseFloat(val[2])+0.1;
      csvdata += rid + "," + new_text + "," + new_number + "\n";
     });
     alert(csvdata);

     var request = "";
     request += "<qdbapi>\n";
     request += "<clist>3.6.8</clist>\n";
     request += "<skipfirst>0</skipfirst>\n";
     request += "<records_csv><![CDATA[\n";
     request += csvdata;
     request += "]]></records_csv>\n";
     request += "</qdbapi>\n";

     alert(request);

     var url2 ="";
     url2 +="https://www.quickbase.com/db/bexxn6nrc";
     url2 +="?act=API_ImportFromCSV";

     $.ajax({
      type: "POST",
      contentType: 'text/xml',
      url: url2,
      dataType: "xml",
      processData: false,
      data: request,
      success: function(response) {
       $("#results").html("All done!");
      }
     });
    });
   });
  </script>  
 </head>
 <body>
  <div id="results"></div>
 </body>
</html>
Getting largest value from a column in a table PostURL <html>
 <head>
  <script type="text/javascript" src="https://www.quickbase.com/js/jquery-1.3.2.min.js"></script>
  <script type="text/javascript">
   $(function() {
    var url = "";
    url += "https://www.quickbase.com/db/8emtadvk";
    url += "?act=API_DoQuery";
    url += "&clist=3";
    url += "&slist=3";
    url += "&options=sortorder-D.num-1";
    var selector = "qdbapi record message_id_";
    $("#result").load(url + " " + selector);
   });
  </script>
 </head>
 <body>
  The Maximum [Message ID#] in the Old QuickBase Community Forum is: <div id="result"></div>
 </body>
</html>
What is the "Be The API Technique"? PostURL <img src="http://totallyabsurd.com/be%20the%20bike.GIF" style="display:block;margin-left: auto;margin-right: auto;">

<iframe id="QBU_myiframe" name="QBU_myiframe" style="display:none;"></iframe>

<script id="QBU_template" type="text/html">
  <table border="1" cellpadding="5" cellspacing="0" style="margin-left:auto; margin-right:auto;">
    <tr>
      <th>Name</th>
      <th>Email</th>
      <th>ID</th>
      <th>Screen Name</th>
      <th>Last Access</th>
      <th>Last Visited</th>
    </tr>
    {{#users}}
    <tr>
      <td>{{name}}</td>
      <td>{{email}}</td>
      <td>{{id}}</td>
      <td>{{screenName}}</td>
      <td>{{lastAccess}}</td>
      <td>{{lastVisited}}</td>
    </tr>
    {{/users}}
  </table>
</script>

<div id="QBU_results"></div>

<script>
  var template = $("#QBU_template").html();

  var url1 = "bh3c5iqzf";
  url1 += "?a=dbpage";
  url1 += "&pagename=jquery.iframe.js";
  $.getScript(url1,function(){

    var url2 = "bh3c5iqzf";
    url2 += "?a=manageusers";

    $("#QBU_myiframe").src(url2, function(duration) { 

      var QBU_userModels = $("#QBU_myiframe")[0].contentWindow.gManageUsers.view.collection.models;
      var QBU_Users = [];
      for (var i=0; i<QBU_userModels.length; i++) {
        QBU_Users.push(QBU_userModels[i].attributes);
      } 

      var results = Mustache.render(template,{users: QBU_Users});
      $("#QBU_results").html(results);

    });

  });
</script>

How to add multiple records with a single click PostURL <html>
 <head>
  <script type="text/javascript" src="https://www.quickbase.com/db/befe2yy7d?a=dbpage&pagename=jquery-1.3.2.min.js"></script>
  <script type="text/javascript" src="https://www.quickbase.com/db/befe2yy7d?a=dbpage&pagename=jquery.url.packed.js"></script>
  <script type="text/javascript" src="https://www.quickbase.com/db/befe2yy7d?a=dbpage&pagename=jquery.protify-0.3.js"></script>
  <script type="text/javascript" src="https://www.quickbase.com/db/befe2yy7d?a=dbpage&pagename=qbu.js"></script>

  <script type="text/javascript">
   $(document).ready(function(){

    var pdbid = $.url.param("pdbid");
    var cdbid = $.url.param("cdbid");
    var rfidval = $.url.param("rfidval");
    var clist = $.url.param("clist");
    var foo = $.url.param("foo") || "bar";

    alert("parent dbid = " + pdbid + "\n" +
          "child dbid = " + cdbid + "\n" +
          "related fid value = " + rfidval + "\n" +
          "column list (in child) = " + clist + "\n" +
          "foo = " + foo)

    var today_ms = (new Date()).getTime();
    var today_plus_7 = new Date(today_ms+604800000);
    var today_plus_14 = new Date(today_ms+1209600000);
    var today_plus_21 = new Date(today_ms+1814400000);

    var randomnumber1=Math.floor(Math.random()*1000);
    var randomnumber2=Math.floor(Math.random()*1000);
    var randomnumber3=Math.floor(Math.random()*1000);

    var csv="";

    csv += "1,";
    csv += "task 1,";
    csv += today_plus_7 + ",";
    csv += randomnumber1 + ",";
    csv += rfidval;
    csv += "\n"

    csv += "2,";
    csv += "task 2,";
    csv += today_plus_14 + ",";
    csv += randomnumber2 + ",";
    csv += rfidval;
    csv += "\n"

    csv += "3,";
    csv += "task 3,";
    csv += today_plus_21 + ",";
    csv += randomnumber3 + ",";
    csv += rfidval;

    alert(csv);

    var url = "https://www.quickbase.com/db/" + cdbid + "?act=API_ImportFromCSV";
    alert(url);

    var request ="";
    request += "<qdbapi>";
    request += "<clist>" + clist + "</clist>";
    request += "<skipfirst>0</skipfirst>";
    request += "<records_csv><![CDATA[";
    request += csv;
    request += "]]></records_csv>";
    request += "</qdbapi>";

    alert(request);

    $.ajax({
     type: "POST",
     contentType: 'text/xml',
     async: false,
     url: url,
     dataType: "xml",
     processData: false,
     data: request,
     success: function(response) {
      var num_recs_input = $("qdbapi num_recs_input",response).text();
      $("#message").html("<h2>You successfully added " + num_recs_input + " child records</h2>").fadeOut(10000,function() {
       window.close();
      });
     }
    })

   });
  </script>
 </head>

 <body>
  <div id="message"></div>
 </body>

</html>
How to directly integrate to Highcharts? PostURL <div id="QBU_mychart"></div>

<script src="https://quickbase.intuitcdn.net/res/53078-33/js/highcharts/highcharts.js"></script>
<script src="https://quickbase.intuitcdn.net/res/53078-33/js/highcharts/highcharts-more.js"></script>
<script src="https://quickbase.intuitcdn.net/res/53078-33/js/highcharts/modules/exporting.js"></script>

<script>
  
  $(function () { 

    var url = "";
    url += "bh4wekic4";
    url += "?act=API_GenResultsTable";
    url += "&jsa=1";
    $.getScript(url,function(){

      var data = _.map(qdb_data,function(rec){
        return [rec[0],parseFloat(rec[1])];
      });

      var chart = new Highcharts.Chart({
        chart: {
          renderTo: "QBU_mychart",
          plotBackgroundColor: null,
          plotBorderWidth: null,
          plotShadow: false
        },
        title: {
          text: 'Browser market shares at a specific website, 2010'
        },
        tooltip: {
            pointFormat: '{series.name}: <b>{point.percentage}%</b>',
            percentageDecimals: 1
        },
        plotOptions: {
          pie: {
            allowPointSelect: true,
            cursor: 'pointer',
            dataLabels: {
              enabled: true,
              color: '#000000',
              connectorColor: '#000000',
              formatter: function() {
                return '<b>'+ this.point.name +'</b>: '+ this.percentage +' %';
              }
            }
          }
        },
        series: [{
          type: 'pie',
          name: 'Browser share',
          data: data

        }]
      });

    });

  });

</script>

automated deletion of records. PostURL <html>
 <head>
  <script src="https://www.quickbase.com/js/jquery-1.3.2.min.js" type="text/javascript"></script>    
  <script type="text/javascript">
   $(function() {

    var dbid = "YOUR DBID HERE";
    var qid = 5;

    var url1 = "";
    url1 += "https://www.quickbase.com/db/" + dbid;
    url1 += "?a=q";
    url1 += "&qid=" + qid;
    prompt("url1",url1);

    $.ajax({
     type: "GET",
     async: true,
     url: url1,
     success: function(response1) {
      prompt("response1",response1);

      var re = /qbRIDlistID='(\d+)'/m;
      ridlist=response1.match(re)[1];
      prompt("ridlist",ridlist);

      var url2 = "https://www.quickbase.com/db/" + dbid;
      url2 += "?ridlistid=" + ridlist;
      url2 += "&act=DoMultiDelete";
      prompt("url2",url2);
      $.ajax({
       type: "GET",
       async: true,
       url: url2,
       success: function(response2) {
        prompt("response2",response2);
        $("#results").html("All Done");
       }
      });
     }
    });
   });
  </script>  
 </head>
 <body>
  <div id="results"></div>
 </body>
</html>
Unable to upload file via URL PostURL   <form action="https://www.quickbase.com/db/DBID?a=FinishEditRecord
        method="POST" 
        encoding="multipart/form-data" 
        enctype="multipart/form-data">

   <table border="0">

    <tr>
     <td align="right">File</td>
     <td><input type="file" name="_fid_7" id="_fid_7" /></td>
    <tr>

    <tr>
     <td>&nbsp;</td>
     <td><input type="submit" value="Upload"/></td>
    <tr>

   </table>
   <input type="hidden" name="subact" value="save"/><br/>
   <input type="hidden" name="oldstyle" value="true"/><br/>

  </form>
Showing Custom Percents in Summary Table Reports PostURL <html>
 <head>
  <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
  <script type="text/javascript" src="https://www.quickbase.com/db/bfag8subs?a=dbpage&pagename=MicroTemplating.js"></script>
  <script type="text/html" id="mytemplate">
   <table border="1" cellpadding="4">
    <tr>
     <th align="right">Activity</th>
     <th align="right">Number Registered</th>
     <th align="right">Number Attended</th>
     <th align="right">Attended / Registered</th>
    </tr>
    <tr>
     <td align="right">DA</td>
     <td align="right"><%= n01 %></td>
     <td align="right"><%= n05 %></td>
     <td align="right"><%= n09 %></td>
    </tr>
    <tr>
     <td align="right">DT</td>
     <td align="right"><%= n02 %></td>
     <td align="right"><%= n06 %></td>
     <td align="right"><%= n10 %></td>
    </tr>
    <tr>
     <td align="right">MH</td>
     <td align="right"><%= n03 %></td>
     <td align="right"><%= n07 %></td>
     <td align="right"><%= n11 %></td>
    </tr>
    <tr>
     <td align="right">MT</td>
     <td align="right"><%= n04 %></td>
     <td align="right"><%= n08 %></td>
     <td align="right"><%= n12 %></td>
    </tr>
    <tr>
     <th align="right">All</th>
     <th align="right"><%= t1 %></th>
     <th align="right"><%= t2 %></th>
     <th align="right"><%= t3 %></th>
    </tr>
   </table>
  </script>

  <script type="text/javascript">

   $(function() {
    $.ajaxSetup({async: false})
    var url01 = "https://www.quickbase.com/db/bfag8sufp?act=API_DoQuery&query={7.EX.DA}";
    var url02 = "https://www.quickbase.com/db/bfag8sufp?act=API_DoQuery&query={7.EX.DT}";
    var url03 = "https://www.quickbase.com/db/bfag8sufp?act=API_DoQuery&query={7.EX.MH}";
    var url04 = "https://www.quickbase.com/db/bfag8sufp?act=API_DoQuery&query={7.EX.MT}";
    var url05 = "https://www.quickbase.com/db/bfag8sufp?act=API_DoQuery&query={7.EX.DA}AND{8.EX.1}";
    var url06 = "https://www.quickbase.com/db/bfag8sufp?act=API_DoQuery&query={7.EX.DT}AND{8.EX.1}";
    var url07 = "https://www.quickbase.com/db/bfag8sufp?act=API_DoQuery&query={7.EX.MH}AND{8.EX.1}";
    var url08 = "https://www.quickbase.com/db/bfag8sufp?act=API_DoQuery&query={7.EX.MT}AND{8.EX.1}";

    var n01=$($.get(url01).responseXML).find("record").length;
    var n02=$($.get(url02).responseXML).find("record").length;
    var n03=$($.get(url03).responseXML).find("record").length;
    var n04=$($.get(url04).responseXML).find("record").length;
    var n05=$($.get(url05).responseXML).find("record").length;
    var n06=$($.get(url06).responseXML).find("record").length;
    var n07=$($.get(url07).responseXML).find("record").length;
    var n08=$($.get(url08).responseXML).find("record").length;

    var n09num=100*parseInt(n05)/parseInt(n01);
    var n10num=100*parseInt(n06)/parseInt(n02);
    var n11num=100*parseInt(n07)/parseInt(n03);
    var n12num=100*parseInt(n08)/parseInt(n04);

    var n09=n09num.toFixed(2) + " %";
    var n10=n10num.toFixed(2) + " %";
    var n11=n11num.toFixed(2) + " %";
    var n12=n12num.toFixed(2) + " %";

    var t1="Total: " + (n01 + n02 + n03 + n04);
    var t2="Total: " + (n05 + n06 + n07 + n08);
    var t3="Average: " + ((n09num + n10num + n11num + n12num) / 4).toFixed(2) + " %";

    var parameters = {
     n01: n01,
     n02: n02,
     n03: n03,
     n04: n04,
     n05: n05,
     n06: n06,
     n07: n07,
     n08: n08,
     n09: n09,
     n10: n10,
     n11: n11,
     n12: n12,
     t1: t1,
     t2: t2,
     t3: t3
    };

    $("#results").html(tmpl("mytemplate", parameters));

   });
  </script>
 </head>
 <body>
  <div id="results"></div>
 </body>
</html>
Integration with Google Charts - to display within a Quickbase Dashboard PostURL <script type="text/javascript">
$(function() {
$.ajaxSetup({async: false});
$.getScript("bfaxxit5r?a=dbpage&pagename=jgcharts.js");
var api1 = new jGCharts.Api();
opt1={
data : [[153, 60, 62], [113, 70, 60], [120, 80, 40]]
};
$("<img>").attr('src', api1.make(opt1)).appendTo("#chart1");

var api2 = new jGCharts.Api();
opt2={
data : [[153, 60, 52], [113, 70, 60], [120, 80, 40]],//mandatory
type : 'bhg'//default bvg
};
$("<img>").attr('src', api2.make(opt2)).appendTo("#chart2");

var api3 = new jGCharts.Api();
opt3={
data : [[153, 60, 52], [113, 70, 60], [120, 80, 40]],//mandatory
bg : 'FFFFFF',//default false
bg_offset : '000000',
bg_angle : '45',//default 90
bg_type : 'gradient' //default solid
};
$("<img>").attr('src', api3.make(opt3)).appendTo("#chart3");

var api4 = new jGCharts.Api();
opt4={
data : [[153, 60, 52], [113, 70, 60], [120, 80, 40]],//mandatory
type : 'bvs'//default bvg
};
$("<img>").attr('src', api4.make(opt4)).appendTo("#chart4");

var api5 = new jGCharts.Api();
opt5={
data : [[105.7,97.9],[108.1,101.6],[110.7,102.9],[111.0,93.7],[110.0,89.8],[109.0,90.7],
[107.5,93.0],[106.1,94.5],[104.3,91.9],[102.0,93.9],[102.8,93.6],[103.8,92.6],
[102.9,94.0],[102.1,92.7],[100.6,96.0],[101.7,97.9],[101.8,105.0],
[103.3,104.1],[104.0,105.1],[103.7,108.1],[108.4,108.4],[109.4,113.8],
[112.0,109.1],[112.6,106.3],[115.5,106.7],[115.7,108.8],[114.7,118.8],
[115.9,120.4],[116.2,115.9],[118.0,124.7],[123.3,126.5],[127.6,131.6],
[130.3,134.0],[135.5,135.7],[138.2,126.4],[139.6,127.4],[145.1,131.0],
[146.4,129.9],[147.1,133.7],[149.0,138.4],[150.3,141.0],[151.3,139.3],
[153.4,145.3],[152.7,142.9],[152.9,129.2],[152.2,126.0],[151.9,124.8],
[150.1,125.9],[148.2,118.9],[145.3,122.9],[142.9,127.7],[142.6,134.4],
[144.0,138.5],[145.5,138.7],[147.2,141.8],[150.0,139.2],[153.8,145.6],
[155.4,147.6],[157.0,157.9],[158.4,156.2],[162.8,153.9],[162.8,158.6],
[164.7,166.3],[168.5,165.8]], //MANDATORY
type : 'lc'
};
$("<img>").attr('src', api5.make(opt5)).appendTo("#chart5");


var api6 = new jGCharts.Api();
opt6={
data : [[153, 60, 52], [113, 70, 60], [120, 80, 40]],//mandatory
type : 'p'//default bvg
};
$("<img>").attr('src', api6.make(opt6)).appendTo("#chart6");


var api7 = new jGCharts.Api();
opt7={
data : [[153, 60, 52], [113, 70, 60], [120, 80, 40]],//mandatory
type : 'p3',//default bvg
size : '400x200'
};
$("<img>").attr('src', api7.make(opt7)).appendTo("#chart7");

var api8 = new jGCharts.Api();
opt8={
data : [[153, 60, 52], [113, 70, 60], [120, 80, 40]],

//source
//legend : ['Data 1','Data 2','Data 3'],
axis_labels : ['2001','2002','2003'],

//options
size : '400x250',
type : 'lc',

//style
fillarea : true,
fillbottom : true,
filltop : true,

//series line
lines : [[3,3,3],[4,4,4],[5,5,5]],

bg : 'ffffff',
bg_type : 'gradient',
bg_angle : 45,
bg_offset : '81419b',
bg_width : 20

};
$("<img>").attr('src', api8.make(opt8)).appendTo("#chart8");

});

</script>

<div id="chart1"></div>
<div id="chart2"></div>
<div id="chart3"></div>
<div id="chart4"></div>
<div id="chart5"></div>
<div id="chart6"></div>
<div id="chart7"></div>
<div id="chart8"></div>

We're glad you're interested in doing more with Quick Base!

Now we need to make you official before you share apps or manage your account.

Verifying your email lets you share Quick Base with others in your company.

Your work email
Your company
Report Name *
Description
Reports and Charts Panel
Each table has a panel listing its reports and charts, organized in groups.
This report will be listed only for you, in the group Mine.
Only you can see the report in the panel. You can't ever list it for other users. You can still let others open it by sending them links.
Please wait while your new report is saved...
You've made changes
Save
Field label
Column heading override
Justification
What does auto mean?
Fields in:

Fields to Extract:

Name for the new table:
Items in the new table are called:

When you bring additional fields into a conversion, Quick Base often finds inconsistencies. For example, say you're converting your Companies column into its own table. One company, Acme Corporation, has offices in New York, Dallas and Portland. So, when you add the City column to the conversion, Quick Base finds three different locations for Acme. A single value in the column you're converting can only match one value in any additional field. Quick Base needs you to clean up the extra cities before it can create your new table. To do so, you have one of two choices:

Read more about converting a column into a table.

Show fields from Show fields from Show fields from a related table