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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

Top Solution Authors
Top Kudoed Authors
Users online (1,983)