Delete records automatically each night

I want to create a task that deletes records that meet a criteria nightly.

For example, I want to delete records where the Name field is blank. 


Any way to do this?




1 Like

This post was helpful to me and I was successful in getting it configured using Integromat. My goal was just to delete all the records in an object every night around midnight. 

I wanted to share how I configured this in Integromat for anyone else wanting to do the same. 

In Integromat:

1) Create a new scenario and the first module will be the Knack Search records. Select your object. 
2) The 2nd module I created was the Integromat Data Store. I had to use this because if I just connected Knack Search directly to Knack delete, it would fail. I figured I could search for records first, import the records ids into the Data Store, then have Knack Delete process that queue. It works. You need to define a storage space limit for this data store as you can have many and the total limit is 10mb. I selected 1mb to start but could probably get away with a 10th of that. Also, the Data Store module will use 'Add/Replace' as it's action. Take a look at my screenshot of the config. 
3) Added 3rd module Knack Delete and it processes the data store values. 
4) In the scheduling attached to the 1st module (Knack Search) I set this to occur once a day at 11:30pm. 

Hope this helps. 

Yes, a new version of the Knack 'app' in Integromat was released last night - it added Delete and Upload file features!



Something to beware of in the new Knack / Integromat app is that the Update operation seems to need to have all the fields filled in rather than just those you want to replace. I'm pretty sure this is different to how the previous version worked. I've let Integromat support know about this.


I just used Integromat and the delete module was there so I made a test scenario that deletes records that have expired. This was the solution I was looking for - maybe it has reappeared since but have a look and see if it works for you.

T, if you look in Integromat at the My Apps section, you can create a module, that will take your knack api keys and build a http object based delete module using the DELETE https://api/ and then chain this into your integromat scenario... It's the same request you'd put into a powershell script, just within integromat. 

It'll take a bit of work, but then you'd have a delete module.. It's fairly easy to get a basic one working for one object.. If you want to make it generic it gets trickier.. But it's doable if you want to spend the time.. 

A powershell script workaround is probably the best option I think but requires a server to schedule it, and a close eye maintaining it including handling any modifications to the Knack table design - I can imagine an ensuing disaster if a filter is no longer there and valid records are deleted!

Thanks Brad. Just voted. Hopefully Julian has a tip for using Integromat in the mean time.

Hmm, these are interesting options. Much better than my approach. But to check: can I write a delete module in Integromat? That doesn't seem to be an option that I see. Can you provide a tad more details? Thanks. This would be a lifesaver.

Here's the feature request for scheduled task to delete records to vote for and comment: 

Sorry, yeah, I forgot that wasn't in tasks... 

Your other option is to write a module in integromat that does the delete,  Or write a powershell script using the knack api you schedule. I've done both these but not specifically for this..  And yes, knack is amazing and yet completely frustrating at the same time... 

Thanks, Julian, that may be my only option (using the builder). I have a task that will create about 6k records at a time.  Unfortunately, these will need to be deleted and rewritten each night, so I am forced to find a way to delete these records every day.  I guess the builder is the only way to do this for now.  

Love Knack, but wow, this seems like a shortcoming for sure. 

Thanks again for helping me on this. 


I just mark them as deleted by setting a field and then use filters to keep them out of the UI. Remember you can then use delete in builder to get rid of them - horrible solution I know.

Well dang. I was getting my hopes up from Swales' post.  Sounds like there was a way to do this before? Perhaps Knack or Integromat pulled it?  Hmmm.


So if my app requires the use to delete in bulk, how do you do it for your clients Julian? 


There is no delete option in Knack tasks unfortunately- at the moment the only option would be to use JavaScript- although I find using it really unfriendly. 

I love Knack as long as I don’t need to code. 

So Swales, just to make sure, in your step about "Then have a task on Knack, that runs nightly or whenever to delete any record with that value set to Yes.", you are able to set an action in Knack to delete records using tasks? That is where I am running into trouble. Can't seem to find this as an action. I can only see "update, insert, or email."  I am probably missing something here though.  Thanks for the help on this. 


Hopefully this conversation will bring some attention to this needed feature.  

Personally I hate having redundant records in databases but I’ve had to do precisely this type of thing for clients - especially when record count is the basis of cost! I hope either Integromat respond or Knack add both Cascade delete and delete options to Tasks!!

Well, it does seem as if the Delete Module has disappeared.. However here's how I would get around it.. 

Add a Yes/No field called to "To Be Removed" on the object you want to remove records from. Default it to No

Have Integromat update that field to be Yes, where you call the delete.

Then have a task on Knack, that runs nightly or whenever to delete any record with that value set to Yes.

And if you need those values not to show up in tables etc, just use a filter in the interface..  


Dang, that is a bummer, I am trying desperately to find a way to delete records in bulk (especially since Knack uses # of records as a limit for our accounts).  I will vote for this feature as well, but seems like this has been in the request queue for a while. Thanks, Julian for the quick response on this!

I think thee used to be a delete option for Knack in Integromat- but there isn’t at the moment. I made a product suggestion about it recently and it would probably help if more people did the same. We certainly need a programmable way to delete records!!

Just came across this thread, which is exactly what I need. I set up an account, created a first module about searching for my records within an object, but I can't seem to set up a second step for deleting the records that are found. I can't seem to find a "Delete module." Any thoughts on this? Thanks for the help.