How can I retrieve,add data using Quickbase API and javascript -
i new quickbase.
want query quickbase using javascript table records , insert it.
how should this?
any highly appreciated.
to improve @rtpharry's answer, javascript sdk referencing has seen better days. hasn't been updated in 2 years, , doesn't work in ie11.
now shameless plug, full disclosure, author of module;
but node-quickbase much, easier use , works both in browser , on server - no code change.
here example:
within nodejs:
var quickbase = require('quickbase'); var quickbase = new quickbase({ realm: 'www', apptoken: '*****' }); quickbase.api('api_authenticate', { username: '*****', password: '*****' }).then(function(result){ return quickbase.api('api_doquery', { dbid: '*****', clist: '3.12', options: 'num-5' }).then(function(result){ return result.table.records; }); }).map(function(record){ return quickbase.api('api_editrecord', { dbid: '*****', rid: record[3], fields: [ { fid: 12, value: record[12] } ] }); }).then(function(){ return quickbase.api('api_doquery', { dbid: '*****', clist: '3.12', options: 'num-5' }); }).then(function(result){ console.log(result); }).catch(function(err){ console.error(err); });
within browser:
<script type="text/javascript" src="quickbase.browserify.min.js"></script> <script type="text/javascript"> var quickbase = new quickbase({ realm: 'www', apptoken: '*****' }); quickbase.api('api_authenticate', { username: '*****', password: '*****' }).then(function(result){ return quickbase.api('api_doquery', { dbid: '*****', clist: '3.12', options: 'num-5' }).then(function(result){ return result.table.records; }); }).map(function(record){ return quickbase.api('api_editrecord', { dbid: '*****', rid: record[3], fields: [ { fid: 12, value: record[12] } ] }); }).then(function(){ return quickbase.api('api_doquery', { dbid: '*****', clist: '3.12', options: 'num-5' }); }).then(function(result){ console.log(result); }).catch(function(err){ console.error(err); }); </script>
Comments
Post a Comment