Jump to content
  • 0
johnv

Triggered action to delete records older than 10 minutes

Question

Hi,

Does anyone know how I can create a trigger to delete records in a table that are older than say 10 minutes?  I can do this easily with SQL statements but can't get my head around how to do this in the drag-and-drop screen for triggered actions.

thanks.

John

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

You need to have two fields added to your table, one timestamp and another field which adds 10 minutes to that timestamp. Then create a scheduled trigger task that runs, for instance, every minute (since min is hourly you need to create probably 60 tasks ) and if that formula value is before now delete.

Share this post


Link to post
Share on other sites
  • 0

Tasks can only run Hourly, Daily, Monthly. For better performance, it is advised that you have a leeway of 15 minutes for every task. in this case, you can only run 4 tasks per hour. So for the task to run every minute, you have to create 4 tasks, just what Maymusic has mentioned. So I think, it's not possible for you to run it every 10minutes. Unless, maybe if you set different timezones, which I have not yet tried. 

Share this post


Link to post
Share on other sites
  • 0

Running a Task every 1 hour might not be your best bet since it will frequently have to run through tables. It could affect the performance of your Application.

 

Why not create a View that filters out the record created 10 minutes prior to current timestamp?

To do so, just add 10 minutes to your timestamp field so we can identify which fields we can show (more on this below).

image.png.04757fff7bee8997f9a5bbb131743e98.png

 

Create a view to return the records that are created 10 minutes offset advanced of the current time

 

After then, just use this as your DataSource instead of the actual table.

image.png.1916264d3e39936221f30c8f7df8e242.png

 

You may use tasks to clean-up your actual table. Maybe once a day, or perhaps every three hours at most.

 

Hope this solution helps.

-DN31337!

Share this post


Link to post
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...