Forum Discussion
_anomDiebolt_
7 years agoQrew Elite
Use script similar to this:
Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=684
Notes:
(1) This code uses both (a) jQuery AJAX promises and (b) ES6 promises to overcome a chaining bug in jQuery ver 1.71 which QuickBase uses.
(2) This code uses (a) fat arrow functions, (b) object property shortcuts and (c) backticks. Get used to it!
(3) I have intentionally put a typo in the code (ie XXX) so you will have to intentionally remove it before running the code and automatically deleting all your table data.
var apptoken = 'cer56xc7ch49v55zbh4b67fwpu';Just supply your apptoken, and array of dbids. If the purging of the tables is part of a pipeline of processing you can provide appropriate feedback after the purge and continue any further processing within the then() method.
$.ajaxSetup({data: {apptoken}});
var dbids = ['bn5qk6g8x', 'bn5qk6ynt'];
Promise.all(dbids.map(dbid => {
Promise.resolveXXX($.get('${dbid}?act=API_PurgeRecords'));
})
).then(response => {
console.log('Tables Purged');
alert('Tables Purged');
$.jGrowl('Tables Purged', {life: 5000, theme: 'jGrowl-green'});
// further processing
});
Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=684
Notes:
(1) This code uses both (a) jQuery AJAX promises and (b) ES6 promises to overcome a chaining bug in jQuery ver 1.71 which QuickBase uses.
(2) This code uses (a) fat arrow functions, (b) object property shortcuts and (c) backticks. Get used to it!
(3) I have intentionally put a typo in the code (ie XXX) so you will have to intentionally remove it before running the code and automatically deleting all your table data.