Trying to remove duplicate keys in array

Sup guys!

In my scenario i’m trying to take a list of profiles and basically return all the profiles that appear in the list more than 3 times (by looking at the profileLink column)

So I’ve done an Array Aggregator step to group by the ‘profileLink’ key so I could find out how many times each link appeared in the array

However after filtering out all the links that appear less then 3 times, I tried to do a distinct filter to remove all the duplicates, however i’m catching an error

Any thought on what i’m doing wrong here? Thanks!

Here’s my blueprint:
blueprint (4).json (54.7 KB)

And my output bundle for my array aggregator step:
bundle.txt (830.3 KB)

Appreciate it guys!

Hey @aosbornee ,

I think this should be achieved by using the deduplicate() function. Have you already tried this approach before?

Thank!
~ Jock

1 Like

Appreciate the response Jock!

At what part of the flow can I run the deduplicate?

I’d want to run it after I’ve aggregated all the ‘profileLinks’ and then filtered out those that appear less then 3 times

This is not correct.

The deduplicate function only works on an array containing primitive values.

The distinct function should be used instead for an array of collections.

samliewrequest private consultation

Join the unofficial Make Discord server to chat with other makers!

1 Like

They are already grouped by profileLink, so there are no duplicates in the top-level aggregated array.

What you can do to access each profile in the sub-array of each grouped profile, is the following:

Output

Screenshot_2024-05-07_220527

Or, you can aggregate all profiles with a text aggregator, and selecting the array sub-properties (which will also grab from the first array’s item)

Screenshot_2024-05-07_220530

1 Like

I think you’re right @samliew. Thanks!