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 / Delete Empty Records f...
Power Apps
Unanswered

Delete Empty Records from gallery and SharePoint

(0) ShareShare
ReportReport
Posted on by 9

Hi All,

 

I have created a powerapp using a gallery to allow me to easily add new items.

When an item is saved, it is patched to SharePoint.

When in edit mode "x" will discard your changes, or the item will be deleted if there are no values in the row. 

 

What I am struggling with is, I can press the "Add New" button multiple times, which then introduces empty records into my app and into Sharepoint. I need a way to ensure all empty record are deleted. 

 

Any ideas?

powerapp.PNG

Categories:
I have the same question (0)
  • pawanjajoo Profile Picture
    191 on at

    Hi @yussuf0100 ,

     

    You can disable the "Add" button on click and enable it again after "Save" button is clicked. It would save each row and allow you to add next row only when previous row is saved.

     

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

    Pawan

    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.

  • yussuf0100 Profile Picture
    9 on at

    Hey @pawanjajoo this is a great solution however when users press the new button, if they refresh the page, it stores the blank item.

     

    I need a way to delete empty records when a page is refreshed. 

  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @yussuf0100 ,

    What do you mean about "when a page is refreshed" in details?

    Do you mean that refresh the website when playing this app?
    If so, you could try to set this screen's OnVisible and app's OnStart:

    RemoveIf(datasourcename,IsBlank(SHORT DESCRIPTION))

    Then when you load this screen and open this app, you will remove all the items that  SHORT DESCRIPTION field is  blank.

     

     

    Best regards,

  • yussuf0100 Profile Picture
    9 on at

    Hey @v-yutliu-msft 

     

    Thanks for responding. Yes, on Playing the App or using the "Refresh" icon on the page. 

     

    I tried this approach but all it seemed to do was delete all records in the sharepoint list being used. 

  • SaiKrishnaGudluru Profile Picture
    499 on at

    try this Remove(SPList, Filter(SPList, Title ="")). basically this is as same as @v-yutliu-msft  suggested.

     

    Or else before calling the patch try to check if the values are not blank for the Fields... go for Patch in case of not empty.

     

     

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 379 Most Valuable Professional

#2
11manish Profile Picture

11manish 203 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard