cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ardions
Helper I
Helper I

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 @Ardions ,

 

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 @Ardions ,

 

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

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (933)