Skip to main content
Question

Deleting records by record id

  • November 26, 2016
  • 0 replies
  • 90 views

I am updating my tables for the last time but I have noticed I have around 65 records which should not be there.  What is the quickest way to delete this.  I do have their record ID.  There is no other criteria available to me unless to find each record and delete it. 
This topic has been closed for replies.

do you have a list of these record ID's in Excel?

  • Quickbase Alumni
  • November 26, 2016
If you know the rids you can generate the query using some script entered into the console:

var rids = [4,56,100,677];
var query = "&query={3.EX." + rids.join("}OR{3.EX.") + "}";
console.log(query);

output:

&query={3.EX.4}OR{3.EX.56}OR{3.EX.100}OR{3.EX.677}

  • Author
  • Quickbase Alumni
  • November 26, 2016
Yes, I do.

If you have these record ids in excel you can make a formula like this

1234 OR 2345 OR 4567

Then paste that into the filter criteria for a report.

  • Author
  • Quickbase Alumni
  • November 26, 2016
Pl take me through a little more detail. Is this the function I create?

  • Quickbase Alumni
  • November 26, 2016
Press F12 to expose the Developer Tools. Then paste my code into the console tab.. Copy out the &query output and paste it into the address bar of an existing URL.

I live in the Developer Tools and only enter things into QuickBase when they work in the console.

  • Author
  • Quickbase Alumni
  • November 26, 2016
I tried to add all record ids.

var rids = [4804,6293,5338,9105,8192,7179,7620,6787,7604,8810,7775,7608,8813,8586,8635,8238,8999,8397,7194,7959,9173,7293,9165,8684,9081,7564,7976,9223,7299,9192,8648,8865,7796,7720,7773,8551,7193,8352,8821,8837,8602,7659,8355,9151,9212,8866,8631,8658,9178,7151,8400,7841,8685,8870,7644,9126,9107,7489,9136,8388,10533,7279,8637,9153,8391];
var query = "&query={3.EX." + rids.join("}OR{3.EX.") + "}";
console.log(query);


When I pasted in the address bar it takes me to Google.

  • Quickbase Alumni
  • November 26, 2016

... well if you are going to do that, then whjy not just do this my method and paste that into the filter for a report.

Where [Record ID#] equal to  

1234 OR 2345 OR 4567

The OR must be in upper case

  • Quickbase Alumni
  • November 26, 2016
Without using JavaScript I don't see the point.

  • Author
  • Quickbase Alumni
  • November 26, 2016
Thanks both.  I managed to delete these records using Mark's technique. But Dan's solution is good.  I am little apprehensive of deleting  in this manner as I really don't know what am I doing.  I am at a crucial stage as I am rolling out and just cannot afford any issues.  Will definitely learn few things from you Dan.

:)

  • Quickbase Alumni
  • November 26, 2016
It is Mark that I am worried about. He really has to get on the JavaScript train.

  • Quickbase Alumni
  • March 21, 2018
So not sure if this is relevant but I found this thread when wanting to delete a list of record ids. 

I have table structure of opportunities -> Facilities -> Asssets. 

I had a list of assets that I wanted to delete from an opportunity but not all assets associated with that opportunity (567 of them). I tried this method and it was to tedious in excel to write the formula with all the record id's to find them. What I did instead was move all the facilities that had the assets I wanted into a new opportunity. Then deleted all the assets associated with the original opportunity. Then I can move all the facilities with assets I want back into the original opportunity.  I know this is not exactly what this thread is about. But think of it like figuring out a way to be able to create a filter for the records you want to delete. I did this by moving all the records to be associated with another parent table record and then deleting. So taking the list excel list of record IDs, running an update, then a report and grid edit to delete. Hope this helps.