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 Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (2,165)