Output only unique object classes in a many-to-many relationship data

Hi,

I’m new to AppFarm and I’m struggling a bit with the data layer. I have an object class that represent a many-to-many relation between two objects X and Y. And when I want to render all Y’s for the X’s I have I get duplicate Y’s when they are connected to more than one of the X’s.

How can I ask AppFarm to only return unique values? Is this possible?

Hi!

So, having s many-to-many relationship, and you want unique entries of one of the sides, you may do as follows.

Lets use an example: Project Participant (many to many between Project snd Person).

Project Participants is a datasource in your App, holding all participants for all projects, and you want to list unique projects:

  1. Add a datasource (suggested naming) Projects (unique), Runtime only with cardinality Many
  2. Do a read objects with filter Projects (unique).ID exists in Project Participants.Project

Projects (unique) now holds all unique projects.