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 / Remove multiple Record...
Power Apps
Unanswered

Remove multiple Records where the LookUpColumn.Id = Variable.Id onSelect of DeleteButton outside the gallery

(0) ShareShare
ReportReport
Posted on by 14

Hello PowerMasters, 

In my Canvas App screen I am not using any Forms, just a gallery to show records and then popup controls to create, edit and delete records.

If I edit the selected record in the gallery and then use the Save button to patch the modification. It must remove all the records from the Dataverse Table RadioUnitTechnos that match the lookup column HWElement.Id = SelectedRecord.SearchHWElementId. 

But It's sometimes removing only one record and my Remove function is giving errors.

This is the code on the SaveBtn onSelect: 

 

//Remove any records from RadioUnitTechnos where HWElementId matches SelectedFeeder.SearchHWElementId and SearchTechnoBandName is not in colTechnoBands.


If(
!IsBlank(SelectedFeeder),
Remove(
[@RadioUnitTechnos],
LookUp( [@RadioUnitTechnos],
HWElementId.Id = SelectedFeeder.SearchHWElement && !(SearchTechnoBandName in colTechnoBands[@id])
)));

 

The Table RadioUnitTechnos is a many to one HWElement Table. I tried using function ForAll and RemoveIf but wasn't successful.

And we also have a TrashIcon to delete the records, with code:

 

RemoveIf(RadioUnitTechnos, HWElementId.Id = SelectedFeeder.SearchHWElementId

&& !(SearchTechnoBandName in colTechnoBands[@id]))

 

2 conditions because there can be multiple RadioUnits with the same lookup column HWElementId.

 

Another try with ForAll:

ForAll( [@RadioUnitTechnos], RemoveIf( [@RadioUnitTechnos],

LookUp( [@RadioUnitTechnos], HWElementId.Id = SelectedFeeder.SearchHWElement

/* && !(SearchTechnoBandName in colTechnoBands[@id]) */

).Id = [@RadioUnitTechnos].Id ) )

 

I think the problem is with the many to one relationship? And then deleting multiple records but not with the Id of RadioUnits?

Then maybe I do have to make a Collection to use this with id = col.id?

 

 

Categories:
I have the same question (0)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 610

#2
Haque Profile Picture

Haque 317

#3
WarrenBelz Profile Picture

WarrenBelz 315 Most Valuable Professional

Last 30 days Overall leaderboard