cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
OlaH
Level: Powered On

Automatically delete records older than 7 days?

How would you do to automaically delete all of the records that are older than a week in a datasource?

In OnVisable, OnHidden or OnSelect (then new ones are saved)? How would you write the formula?

1 ACCEPTED SOLUTION

Accepted Solutions
OlaH
Level: Powered On

Re: Automatically delete records older than 7 days?

Thank you, @carlosag 

 

RemoveIf(Table1;DateColumn<Today())

 

I had text, instead of date format, in DateColumn at first but when I changed, it works fine.

I placed it in OnVisible.

View solution in original post

4 REPLIES 4
Leo09
Level 8

Re: Automatically delete records older than 7 days?

Hi there,

 

Tried with different formulas but this seems cannot be done in powerapps. I think. Suggest you to post an idea. I will vote on it.

 

John

Community Support Team
Community Support Team

Re: Automatically delete records older than 7 days?

 

 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Power Apps Staff carlosag
Power Apps Staff

Re: Automatically delete records older than 7 days?

Did you try using the RemoveIf formula? (Maybe inside a button OnSelect)

 

Calling something like:

    RemoveIf(YourTable, Recommended_quantity< 100)

 

Having said that, if the goal is to do that automatically, then it might be best to setup a Microsoft Flow with a daily recurrence trigger that then uses the Delete action on the right rows. That way no user interaction is required and rows would be deleted automatically. Finally if the rows are in SQL then for performance it might be best to write a store procedure that deletes rows and you can the store procedure from Flow.

 

PowerApps will invoke a single Delete at a time per row which is not optimal if many rows are to be deleted.

OlaH
Level: Powered On

Re: Automatically delete records older than 7 days?

Thank you, @carlosag 

 

RemoveIf(Table1;DateColumn<Today())

 

I had text, instead of date format, in DateColumn at first but when I changed, it works fine.

I placed it in OnVisible.

View solution in original post

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (4,955)