cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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.
PowerApps Staff carlosag
PowerApps 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
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 334 members 6,621 guests
Please welcome our newest community members: