FREE OutSystems Workshops - Build an OutSystems App in 1 hour | ENROLL NOW

Tech Bites - Set timers to delete records

< Back to Blog

Hi, and welcome to another Tech Bite.

In this tech bite, we will demonstrate how to set timers to delete records and use an online store as an example.

In the app, we have an entity called Shopping Cart Items, where we save all the items each user is interested in buying.

 

To clear all the shopping carts nightly, we will create a server action Delete All Cart Items. 

Add a SQL node to the server action and write the necessary query to delete all records from that entity. In this case, despite Delete queries not having outputs, every SQL node needs an output structure or entity. Thus we use a dummy output.

 

Next, we’re recording in the system log that the action was completed. Add a Run Server Action to the flow and select the system action Log Message. Add its attributes, Message and Module Name. The recorded message will appear in the OutSystems Service Center logs.

 

Finally, we will create a timer on the processes Tab to run every night. Create a Timer Action Clear Carts that invokes the previously created server Action—Delete All Cart Items— which occurs Daily at 4 in the morning.

 

Now we’re ready to publish. You can check the Service Center logs the morning after to ensure the timer ran as expected.

   

Thanks and see you on our next Tech Bite!

Turn Up Academy

Apply to our Turn Up Boot Camp

AND BECOME THE NEXT OUTSYSTEMS CERTIFIED DEVELOPER
(
Instructor
)

Latest Articles

Tech Bites - Set timers to delete records

Set timers to delete records

In this tech bite, we will demonstrate how to set timers to delete records and use an online store as an example.

Tech Bites
Tech Bites - How to import data from an excel file

How to import data from an excel file

In this video, we’ll show you how to upload and store data from an excel file.

Tech Bites
Tech Bites - How to run aggregates for each table row

How to run aggregates for each table row

In some situations, we need to show specific data in a table row or a list item that might not be directly related to the data we are using on the aggregate.

Tech Bites