Counting Unique Items in List from API Connector

Hi all, I have a RG that I’d like to use to display a list of “agents” returned from the API connector. When I run it and display only the unique agents names, it works like a charm (pic of set-up below)

But what I’d like to do is have another text in each row that counts the number of times each unique agent appears in the list. e.g. if the list returned from the API is:

Agent A
Agent B
Agent A
Agent A
Agent C

then I’d like to display:

Agent A 3
Agent B 1
Agent C 1

Is there a way to do this just using the RG UI, or do I need to add the data from the API to the database before I can perform counts? Thanks so much!

Here’s a working example using a custom state. DM me if you want a quick tutorial: