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

Notifications

Announcements

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard