Retrieve unique element in RG from multiple datas


I would like to retrieve one occurence of each datas coming from my database in a Repeating Group.

Based on this tutorial, I try to create a multi-category selection (checkboxes) : Tutorial: How to Select Multiple Items From a List - YouTube

I have multiple entries that are in the same categories. So basically I have 6 categories (Fruit’s name), and each entry fall in one of them. For example, :
Datatype : Fruit
Field : Fruit’s name (the 6 categories)
Field : Variety
Field : Color

entries :
Apple - Gala - Green
Apple - Golden - Yellow
Pear - Comice - Yellow
Apple - Braeburn - Red
Pear - Bosc - Brown
Peach - White Peach - Orange
etc (like 40-50 entries)

The user has to multi-select (checkbox) between the 6 categories of Fruit’s name : Apple, Pear, Peach etc to see (like in the video) their respective information in another Repeating group.

I can’t figure out how I can set up the Repeating group so it shows only 1 time each occurence of the fruit’s name (eg : peach, apple, pear etc). So far, the RG shows all the occurences so I have (Apple / Apple / Pear / Peach / Apple / Pear / Pear etc)

Thanks a lot

I think here is what you can do.

You only add a Fruit to the next RG ( RG B, that display Fruit information), only when RG B’s list of Fruits’ Fruit’s name does not contains this Fruit’s name.

Thanks for your answer @faisalkarimstubapp !

This solution works for the RG B, but how about RG A ? RG A has to display only 1 occurrence of each fruit’s name that are in the database.

Or do you mean having a RG A (hidden) and RG B (visible) that displays one occurence of each fruit’s name ?

For RG A, you can do something like this.

In RG Data Source, Do A Search For Fruit :group by Fruit’s name

Thanks a lot it worked !

This topic was automatically closed after 70 days. New replies are no longer allowed.