How to avoid add duplicates with a dropdown selection?

Hello,


I am trying to do a simple IMDB database where i have a list of movies, a list of actors, and i pretend assing more than one actor to a movie. The adding actor action is correct, but I now, I want to restrict the dropdown selection to the left actors that arent selected for this movie.

I have three entities:

  1. movies: (name, year, genre)
  2. actors (firstName, lastName, date of birth and nationality)
  3. movieActor (movieId, actorId) -> list below of the print

How can I do this in reactive?



I already try to implement the filtering on the dropdown list, but what I can do is filtering the current record on the list (following print)



Hello Pedro,

You can do a Data Action and inside you use the SQL SQL element to do a query using WHERE NOT EXISTS  like this

SELECT {Actor}.* FROM {Actor}
WHERE NOT EXISTS
(SELECT 1 FROM {MovieActor}
WHERE {Actor}.[Id] = {MovieActor}.[ActorId]
and {MovieActor}.[MovieId] = @MovieId)

Thanks

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.