How to get Unique Numbers in a Repeating Group

I have a list of Entry’s noted below, I want my repeating group to only show the first instance of a “number” when searching for all entry’s of a specific business that are a draft.

Entry Fields
Business - Related Key
Draft - y/n
Number - Number

Sample Data
biz 1, y, 24
biz 2, y, 24
biz 1, y, 24
biz 1, y, 23

When searching that data set for biz 1 & y, I want my repeating group list result to be…
biz 1, y, 24 (First Item Found)
biz 1, y 23

Thought I could do this with unique elements, but I am struggling to figure it out.

Hi @jack17 :wave: you probably want to use the :group by function in your repeating group.

First, make the content of your repeating group your normal search (e.g. Do a search for > Business > Apply relevant filters)

Then, select :group by, and group by your number field

This means that only the unique entries will show in the repeating group, but you can also aggregate things within that group if you wanted to (e.g. getting a count of the number of times that number occurs within the group)

Let me know how you get on!

When using Group By, how do I reference the first entry in the group to display in the repeating group?

In the repeating group, you should be able to search your database again using This Grouping’s number and the other filters you’ve applied to get :first item

Ahh…that looks like that will work. Many Thanks!! Any thoughts on the performance hit of searching in a search, not to mention the extra work load units? I feel like there should be a more direct way to do this.

I’m not sure about the Workflow Units, but if you’re looking for a more direct way, you could group by Number and Business, then just display This Grouping’s number and This Grouping’s Business in your repeating group, which shouldn’t cost you any extra WUs.

You aren’t able to group by a yes/no data type, but if you wanted to replace it with a text field (where the contents were either “yes” or “no”), then you could group by these too and display all your data from the Grouping directly.

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