Jump to content
  • 0

Best practice for deleting Table Records


Ras2019

Question

Hello,

What is best practice for deleting or cancel a record in a table.

1. Keep the record in the table, but make a status field which can filter out the row based on e.g. a cancellation status.

2. Delete the record in the table, but make a separate log table for records deleted. 

I need to consider the table design for future API integrations, and general best practice.

Any recommendations would be appreciated.

Sincerely

Ras

 

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0
43 minutes ago, Ras2019 said:

Hello,

What is best practice for deleting or cancel a record in a table.

1. Keep the record in the table, but make a status field which can filter out the row based on e.g. a cancellation status.

2. Delete the record in the table, but make a separate log table for records deleted. 

I need to consider the table design for future API integrations, and general best practice.

Any recommendations would be appreciated.

Sincerely

Ras

 

Hello @Ras2019,

1. You can add a Yes/No field, checked if Active, unchecked if Inactive. Then, you can use a View to filter the records based on the Status. https://howto.caspio.com/tables-and-views/what-are-views/creating-a-view-to-filter-data/ 

2. To create a record and to save it to other table once the record is deleted to the main table, you need to use a Triggered Action. I have a sample of Triggered Action that you can check.

image.png.508ecf770ac5edbcdfceee34315cd9f0.png

 

Hope this helps. 

Link to comment
Share on other sites

  • 0
On 3/4/2020 at 10:37 AM, Ras2019 said:

Hi Ginger,

Thanks for your response!

Both solutions will do the job, but which one of those two would be the best practice from a data management point of view? 

 

Sincerely

Ras

Sorry for the very late response. In my perspective, between the two options, I would go for option 1 which is using a View. It's best to have all your records to stay in just one place other than having them in a separate Tables. Maybe in the future, you will need a report wherein you need to display all the records. 

Link to comment
Share on other sites

  • 0

Hi @Ras2019,

Just to add more information. If you want to delete your records in your table, you can also create backups for this so that the data that you accidently deleted can be imported back. You can use scheduled task for this and you can set it up to be daily, monthly, yearly, etc. You can check more information here.

 

Regards,

Natoy

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...