I have a collection called as TestCol and it looks like this.
Name ID ToAddress Status
Abc 123 asdfg@example.com,koldef@example.com,asdasdasfda@example.com A
Def 234 nanasd@example.com,asdfg@example.com A
Ghi 567 asdfg@example.com,asdasfg1@example.com B
I want to create a new collection Called as UniqueToAddress like,
ToAddressUnique
asdfg@example.com
koldef@example.com
asdasdasfda@example.com
nanasd@example.com
asdasfg1@example.com
It can be seen that asdfg@example.com is repeated multiple times inside the ToAddress and it appears only once on ToAddressUnique Collection. How Can I do this ?
You can use the following expression to generate a list of unique addresses:
Distinct(
Split(
Concat(TestCol, ToAddress, ","),
","),
Result)
The idea is to first concatenate (using the Concat function) all the addresses in your collection, then split the long string (using the Split function), and finally take only the unique addresses using the Distinct function to get what you need.
Hope this helps!