API repeat using unique not producing unique entries

Hi,

trying to do a shopping cart price API but with a twist as my items have several extra bits of information.

So I pass a datastore from the front end to a server connect action and then I want to have a repeat that only repeats on a product ID. I am using unique to get just the unique productID's but it does not seem to be working.

This is my action (3 products, 2 of one type and one of another):

And want to have two sections (the two product types) with the extra information in the nested repeat. The nested repeat is working but I get 3 products instead of 2, this is what it is outputting:

Can anyone see where I am going wrong?

Thanks, Paul.

Hi.
Try putting quotes in the prop name:

{{$_POST.cart.unique('productID')}}

Although, what this means is that you will just get the productIDs in the response after the formatter is applied.
So your repeat array would look something like:

[
    "123456789",
    "987654321"
]

Hi Sid,

Adding the '' around productID did return two entries instead of three but no data so had a play and it seems to return $ values ($index, $number, $name, $value, $id) but none of the actual details like productID, first name etc.

So had a play and found $value returned the productID (which makes sense since that is what I am asking for as unique) correctly, just a little gotcha for anyone else coming across this thread (and in case I forget in the future).

Thanks for your help