Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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?

  • JN-19081230-0 Profile Picture
    49 on at
    Re: Delete all Dataverse data related to a specific match in a lookup table

    Thank you very much, this fixed my problem😀

  • Verified answer
    anandm08 Profile Picture
    1,936 Super User 2025 Season 1 on at
    Re: Delete all Dataverse data related to a specific match in a lookup table

    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);

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,522 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,890 Most Valuable Professional

Leaderboard