cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Delete recently added items in sharepoint list

Hello people,

I'm using a flow to collect the employees' IDs in an excel file and patch them into my SPlist as new items. This flow is triggered by a button in my App. The problem is, if by mistake you click on the button again, it will add everyone again. I'd like to build an "UNDO" button or something that removes the last added items in case someone double adds them. 
Can you please help? Thank you 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @Anonymous ,

 

I suggest you set the button control to be pressed only once. When the button is pressed for the first time, the displaymode of the button control becomes 'Disabled'.

 

1\ Set the app's onstart property to:

Set(Thevar,1)

 

2\ Add a button control and set its onselect property to:

your flow.Run();Set(Thevar,Thevar+1)

 

Set the button control 's DisplayMode property to:

If(Thevar=1,DisplayMode.Edit,DisplayMode.Disabled)

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

 

View solution in original post

2 REPLIES 2
v-xiaochen-msft
Community Support
Community Support

Hi @Anonymous ,

 

I suggest you set the button control to be pressed only once. When the button is pressed for the first time, the displaymode of the button control becomes 'Disabled'.

 

1\ Set the app's onstart property to:

Set(Thevar,1)

 

2\ Add a button control and set its onselect property to:

your flow.Run();Set(Thevar,Thevar+1)

 

Set the button control 's DisplayMode property to:

If(Thevar=1,DisplayMode.Edit,DisplayMode.Disabled)

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

 

Jagadeeshk
Responsive Resident
Responsive Resident

There are 2 options

Option 1. make a 2 time check before trigger flow like 

in on select on button use set(var_temp,true);

once var_temp set activate another button as second check then in second button trigger flow.

Option2: Add a column in SharePoint like "Update Status" and patch data as "New" once update a list change all only  "Update Status" as "Old" & keep "New" only for latest udpate. 

so in undo button removeif(source, Update Status="New")

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (1,853)