Forum Discussion
QuickBaseCoachD
7 years agoQrew Captain
The API to purge all records is this one
https://help.quickbase.com/api-guide/purgerecords.html
I have an app in the Exhange call URL formuals for Dummies which explains a starting guide to making API buttons.
As per my previous post, at the present time and Automation cannot delete all the records in a table with over 1000 records, and even if you did have a table with under 1,000 records, if a user was waiting for it to process, they would be a lot older when it finally finished. We, they would feel a lot older as its like watching paint dry.
But is easy to make a formula URL button.
var text URLONE = URLRoot() & "db/" & [_DBID_Table name one] & "?act=API_PurgeRecords";
var text URLTWO = URLRoot() & "db/" & [_DBID_Table name two] & "?act=API_PurgeRecords";
var text URLTHREE = URLRoot() & "db/" & [_DBID_Table name THREE] & "?act=API_PurgeRecords";
var text URLFOUR = urlroot() & "db/" & dbid() & "?a=td";
$URLONE
& "&rdr=" & URLEncode($URLTWO)
& URLEncode("&rdr=" & URLEncode($URLTHREE))
& URLEncode(URLEncode("&rdr=" & URLEncode($URLFOUR)))
The button can be located on any of the tables to be purged, as a for ula URL field, and if you choose to, after building the button, if you remove the link name, it will expose that code. You can paste the into a URL button on the dashboard.
Note tat after you run an API, you need to redirect the user to land somewhere or else the system will spew back an unfriendly message on the screen saying that the last step in the purge was successful. So my URLFOUR will land the user on the table home page of the table where the button is built.
Here is code for up to 10.
$URLONE
& "&rdr=" & URLEncode($URLOne)
& URLEncode("&rdr=" & URLEncode($URLTwo))
& URLEncode(URLEncode("&rdr=" & URLEncode($URLThree)))
& URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLFour))))
& URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLFive)))))
& URLEncode(URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLSix))))))
& URLENcode(URLEncode(URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLSeven)))))))
& URLENcode(URLENcode(URLEncode(URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLEight))))))))
& URLENcode(URLENcode(URLENcode(URLEncode(URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLNine)))))))))
& URLENcode(URLENcode(URLENcode(URLENcode(URLEncode(URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLTen))))))))))
Note, I would not recommend going past 10, as the URL gets ridiculously long ands will start to exceed the limits of what the Browser can handle, especially IE has a limit which you might hit.
https://help.quickbase.com/api-guide/purgerecords.html
I have an app in the Exhange call URL formuals for Dummies which explains a starting guide to making API buttons.
As per my previous post, at the present time and Automation cannot delete all the records in a table with over 1000 records, and even if you did have a table with under 1,000 records, if a user was waiting for it to process, they would be a lot older when it finally finished. We, they would feel a lot older as its like watching paint dry.
But is easy to make a formula URL button.
var text URLONE = URLRoot() & "db/" & [_DBID_Table name one] & "?act=API_PurgeRecords";
var text URLTWO = URLRoot() & "db/" & [_DBID_Table name two] & "?act=API_PurgeRecords";
var text URLTHREE = URLRoot() & "db/" & [_DBID_Table name THREE] & "?act=API_PurgeRecords";
var text URLFOUR = urlroot() & "db/" & dbid() & "?a=td";
$URLONE
& "&rdr=" & URLEncode($URLTWO)
& URLEncode("&rdr=" & URLEncode($URLTHREE))
& URLEncode(URLEncode("&rdr=" & URLEncode($URLFOUR)))
The button can be located on any of the tables to be purged, as a for ula URL field, and if you choose to, after building the button, if you remove the link name, it will expose that code. You can paste the into a URL button on the dashboard.
Note tat after you run an API, you need to redirect the user to land somewhere or else the system will spew back an unfriendly message on the screen saying that the last step in the purge was successful. So my URLFOUR will land the user on the table home page of the table where the button is built.
Here is code for up to 10.
$URLONE
& "&rdr=" & URLEncode($URLOne)
& URLEncode("&rdr=" & URLEncode($URLTwo))
& URLEncode(URLEncode("&rdr=" & URLEncode($URLThree)))
& URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLFour))))
& URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLFive)))))
& URLEncode(URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLSix))))))
& URLENcode(URLEncode(URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLSeven)))))))
& URLENcode(URLENcode(URLEncode(URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLEight))))))))
& URLENcode(URLENcode(URLENcode(URLEncode(URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLNine)))))))))
& URLENcode(URLENcode(URLENcode(URLENcode(URLEncode(URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLTen))))))))))
Note, I would not recommend going past 10, as the URL gets ridiculously long ands will start to exceed the limits of what the Browser can handle, especially IE has a limit which you might hit.