web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / PowerApps - Delete spe...
Power Apps
Answered

PowerApps - Delete specific items and then patch new set of records

(0) ShareShare
ReportReport
Posted on by 85

Dear All,

 

I'm building a SharePoint List form based PowerApps. One of the operation is I need to delete specific list items and then patch new set of records right after that.

I'm doing it like below:

 

With(
{
wRecords:
Filter(
SPListName,
customID = DataCardValue31.Text
)
},
RemoveIf(
SPListName,
ID in wRecords.ID
)
);

Patch(SPListName,
UpdateIf(GlobalCollectionName,
Created=Blank(),
{ID:Blank()}
)
);

 

My issue is, sometimes it works but sometimes it just mixes records and before deleting all records goes patching records so final output is wrong. I want the program to wait till it finishes deleting the items and then only patch new set of records.

 

Could you please help. Any help will be appreciated.

 

Thanks,

Sanjay

Categories:
  • Verified answer
    ANB Profile Picture
    7,252 Super User 2026 Season 1 on at

    HI @SanjayAdsure201 , Can you try this code and check the behavior:

    ClearCollect(col_Records,
     Filter(SPListName,
     customID = DataCardValue31.Text
     )
    );
    ForAll(col_Records As var,
     Remove(
     SPListName,
     LookUp(SPListName, ID= var.ID)
     )
    )

    Then rest code for patch will remain same.

    -----------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.👍

    Thanks,
    ANB


     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard