Create a List with unique values

Hi ,
I am using a for loop and extracting a value using get text and i want to add that value into a list.But if that extracted string value is already present in the list then i dont have to add that value into the list.How to do this?

Hi @amruta_George

You can try tlike this

  • Add all the item in the list
  • atlast you can get only the unique item wi this expression

ListOfSTrings.Distinct

Regards
Sudharsan

Hi, i have created the list like this

list=new list(of string)(new string(){value}).
but when i am taking the count of list items its showing as 2 all the time

@amruta_George

Create like this
new list(of string) from {“Value1”,“Value2”}

If you want to check the list in message use this expression
String.Join(“,”,ListOfString.Distinct)

image

Regards
Sudharsan

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.