get unique index list by filtering other list

Hi dear all,

 i'm trying to get a index array from following list. The scenario is that one item refers to one uses' product. If one user has more products, then more items will be created. 

And now im trying to get a list shows all 'individual''s "first" index.Duplicated item should not be collected into the list.

The expecting output list would be:

[1,3,8]

as you can see all individual's first index should be collected into this output list. Currently im using wherecontains() but i cannot detect and remove the duplicated items.

My current output list:

[1,2,3,4,7,8]

Input List:

[[
id:1,
name:Tom,
userType:Individual,
product:Laptop

],
[
id:2,
name:Tom,
userType:Individual,
product:Phone
],
[
id:3,
name:Jerry,
userType:Individual,
product:Laptop
],
[
id:4,
name:Jerry,
userType:Individual,
product:Mac
],
[
id:5,
name:Spike,
userType:Entity,
product:T-bone
],
[
id:6,
name:Spike,
userType:Entity,
product:Laptop
],
[
id:7,
name:Tom,
userType:Individual,
product:Mac
]]

Thanks for your kind help and response.

  Discussion posts and replies are publicly visible