cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
powerapps890
Post Prodigy
Post Prodigy

Delete items in sharepoint list when new ones are submitted

For my app the user is only allowed to submit a max of 10 a day. I want the flow to update and delete previous records every time a submission is sent for that day. So the user can vote an unlimited amount of times a day, but there should only ever be those 10 records for that specific person in the sharepoint list. I am assuming you can do this by taking their email. Basically I just always want the newest items to update in the list and delete the ones they previously submitted.

5 REPLIES 5
yashag2255
Dual Super User II
Dual Super User II

Hi @powerapps890 

 

Can you share more details? Assuming that the user submits  a form from Power Apps, does it then create all 10 items from there? In that case, you can create flow that is triggered when an item is created and then add an action to get items and then you can either use filter query to check if the item was created more than 10 minutes ago from UTC now or use condition for the same and then delete the previously created items.

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

The user will submit 10 checkboxes a day. They can vote as many times as they want in powerapps, but the latest 10 records from that day should be the ones that stay in the data set. I don't want it to change any of the records from other days. The goal is to only save 10 of their latest responses each day. @yashag2255  How do i create a flow with this?

I can't figure out the condition part of the flow @yashag2255 

Hi @powerapps890 

 

In that case, you can do something like this: 

 

1. When an item is created

2. Get items

3. Condition : Created greater than equal to formatDateTime(utcNow(),yyyy-MM-ddT00:00:00Z)

AND Created less than equal to formatDateTime(addMinutes(utcNow(),-10),yyyy-MM-ddThh:mm:ssZ)

 

The condition is to check for all items created today before 10 minutes from now

 

4. In the yes branch, add action to loop over each item returned and delete those for that specific user. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

How do I do a loop so that it only deletes the records for that specific user? @yashag2255 

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (815)