creating a unique list

Hello, I'm reading a record that contains a text field I'd like to have listed in an array. However, the array should only have unique values, so if that text is already in there, I don't need to add it again. I've written this. 

a!localVariables(
  local!arrayOfMakes,
  a!forEach(
    items: a!queryRecordType(
      recordtype: recordType!KD VM Vehicle,
      fields: recordType!KD VM Vehicle.fields.make,
      pagingInfo: a!pagingInfo(
        startindex: 1,
        batchSize: 50)
    ).data[recordType!KD VM Vehicle.fields.make],
    expression: 
    if(
      contains(local!arrayOfMakes, fv!item), null,
      append(local!arrayOfMakes, fv!item) 
    )
  )
)

It returns what I think I need, but it's not unique. Here's part of the output. Further down you would see that it has several entries for the same make. 

All ideas are appreciated!

  Discussion posts and replies are publicly visible

Parents Reply Children