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 all Dataverse d...
Power Apps
Answered

Delete all Dataverse data related to a specific match in a lookup table

(1) ShareShare
ReportReport
Posted on by 49

In my canvas app, I have three tables. For simplicity call them actor (Primary text column:ActorName) , movieactor (Primary column:  ID) , and movie (Primary text column; MovieName). I have a table showing info about the movie, and the actors having played in them. 
I have a delete button, so the user can delete the movie they no longer are interested in. So far so good (

Remove(Movie, tbl_Movie.Selected))

, the problem starts when I first want to delete all related rows in the movieactor table that contains this movie. How can this be achieved by Power Apps formula?

Categories:
I have the same question (0)
  • Verified answer
    anandm08 Profile Picture
    1,936 Super User 2024 Season 2 on at

    hi @Jan_Henrik ,

    To achieve this in PowerApps, you'll need to delete the related rows in the movieactor table before deleting the selected movie from the movie table. You can use the ForAll function along with the Remove function to iterate through the related rows in the movieactor table and delete them. Here's how you can do it:

     

    // Step 1: Identify related rows in the movieactor table
    ClearCollect(
     relatedMovieActors,
     Filter(movieactor, MovieID = tbl_Movie.Selected.ID)
    );
    
    // Step 2: Delete related rows from the movieactor table
    ForAll(
     relatedMovieActors,
     Remove(movieactor, ThisRecord)
    );
    
    // Step 3: Delete the selected movie from the movie table
    Remove(movie, tbl_Movie.Selected);

     

  • JN-19081230-0 Profile Picture
    49 on at

    Thank you very much, this fixed my problem😀

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

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard