A script to delete data with specific criteria

Hello All, I have a use case where some data do not have a relation in my table :slight_smile:
image

is there a way I can delete the rows that do not have a relation automatically? (in this case task 1 &task2)

i don’t want to overwhelm the database with unnecessary relations just to delete the data related to each other. i believe there is an easier way. like a script i can paste it somewhere?
i have this use case in 10 tables related to each other in my app i need a universal solution to help me achieve this.
thanks

Assuming:

a) you’re working with native Glide tables, and
b) you want something that can be triggered by an action

then you only have two options:

  • either navigate to the details screen of the row you want to delete, and delete it, or
  • delete it through a relation (single or multiple)

Hi Darren, thanks for the reply. Yes i am familiar with these approaches.but theydo not work with me and the reason is the large number of interconnected tables in glide.
I don’t necessary needed to be triggered by an action. I am fine with daily auto trigger or any other trigger as soon as it deletes this type of rows automatically.

Okay, for that you’d need to turn to something external to Glide, such as Make, and delete the rows via the API. The options available depend on which plan you have.

Unless your tables are connected to a Google Sheet (you haven’t said), then you could do something with a time triggered Apps Script.

the issue is i am on the starter plan as it suits my needs.I can connect the tables to google sheets. but i think it is easier to delete through multiple relations between tables instead of linking to google sheets.

Yes, I would agree.

I wouldn’t be concerned about that, unless you’re talking about tens of thousands of rows. And if you’re on a Starter Plan, then that sounds unlikely.

1 Like