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 / Confirming what will b...
Power Apps
Unanswered

Confirming what will be deleted before being deleted

(0) ShareShare
ReportReport
Posted on by 270

Hello everyone,

 

I've been testing the RemoveIf function, and rather than deleting what I was expecting it to delete, lots more records were deleted (they were test records, so no harm done). I'm wondering firstly if I can see in a text box which items are going to be deleted when I click a button and secondly, I probably need some help changing the syntax to do what I want it to do, which is only delete the record where the single item selected from the Combo Box ('CbxSelection') is firstly that which is in my column in SQL '2pInx'  & the check box selected is in the same record as  '2pInx', the checkbox is being written in 1rInx  column in SQL. I can see I am missing the '1rInx' in my below syntax but adding it in after the && seems to error on me!

 

The below worked but deleted a lot more records than I was expecting, so I think the code needs a little work: 

 

RemoveIf(
 2rMapping,
 2pInx:CbxSelection.Selected.2pInx = 2pInx && Value(
 LookUp(
 Gallery3.AllItems,
 Checkbox3.Value,
 Value(Checkbox3.Text)
 )
 )
);

 

Categories:
I have the same question (0)
  • BrianS Profile Picture
    2,407 Super User 2024 Season 1 on at

    Not sure about the second part of the question, but since RemoveIf() works on Records, you will probably need a gallery to display what will be deleted. If you filter your datasource with the same logic you use for the RemoveIf(), it should show the same list.

    I'm not positive, but shouldn't the LookUp() be against the data source - not the Gallery?

  • PowerAGuy Profile Picture
    270 on at

    @BrianS 

    The checkboxes are inside the gallery, so doing the lookup against the gallery, well the similar code works for writing to SQL, so tried to use the same logic to remove.... but didn't go according to plan!

     

    I'll give a gallery a try, to see if i can show me which item(s) will be deleted.... may come back for further advice!

  • BrianS Profile Picture
    2,407 Super User 2024 Season 1 on at

    Is the Gallery using a Collection or the SQL list? If you are using the SQL, you could have a Patch in the OnCheck and OnUnCheck to Patch the list, then you could just query the list - may be easier to trouble-shoot

  • PowerAGuy Profile Picture
    270 on at

    Yep, the gallery is pointing to the SQL table.

    I can't figure out how I can see what changes will be made to the gallery by the patch on my OnSelect buttons property... I don't know how I can see this before the change has occured

    I presume the OnCheck and OnUnCheck  of the checkbox will do the same as writing back to SQL, but I want to see which records will be deleted before actually confirming to delete them

  • BrianS Profile Picture
    2,407 Super User 2024 Season 1 on at

    I have  similar app that has a list of tasks and when the user finishes and checks them off they move to another gallery. If you use the check box, then you can have a second step where the records to be deleted will show (just a Filter on that field to populate the Gallery). Then you can be sure what will be deleted, which can be done in the second step 

  • PowerAGuy Profile Picture
    270 on at

    hi @BrianS 

    Some help with the syntax of what I need on the 2nd gallery to display the items marked to be delete as I am struggling to get anything going

  • BrianS Profile Picture
    2,407 Super User 2024 Season 1 on at

    If you are using a checkbox that changes the value in the list, then you can populate the gallery by Filtering the list for rows with that value. Then use the same logic with the RemoveIf to delete the items.

    In the OnCheck something like

    Patch(SQLTable, ThisITem, {DeleteMe:true} )

    and on UnCheck

    Patch(SQLTable, ThisITem, {DeleteMe:false} )

    The Gallery would be

    Filter(SQLTable,DeleteMe=true)

    Then have the same Checkbox logic to give users the chance to fine tune there selection

    then on your final Delete button

    RemoveIf(SQLTable, DeleteMe=true)

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 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 181 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 112 Super User 2026 Season 2

Last 30 days Overall leaderboard