How to create a list in expression

Hi all

I want to create a list in my expression, so I can use the list to check against an attribute I have in my data set. Therefore I can group and classify data from the column.
For example:
AtrributeA : [apples, orange, fruit, fuit, friuut, pears, berries]
List[apples, orange, pears, berries]

so anything not in the list, “fruit” can be rename or filter out.
However I dont see “List” function in the expression , so wonder what function can I use to create a list? thanks

new list(of string)({"apples", "orange", "pears", "berries"})

Hi @cheeran_lo ,
Please go through the sample workflow am sending you.
You can put your data of lists.
CommonVal_between_Lists.xaml (9.6 KB)

And then intersect to get common values between two lists.

The result_list will only contain common values between two lists

Thanks & Regards,
Shubham Dutta

@cheeran_lo ,
To create a list you can use a assign activity
Create a variable for storing the list values
change the datatype to List
In the assign you can give as

var1={“apples”, “orange”, “pears”, “berries”}

you have to give a default value as new list(of String) to the list variable

Hi @cheeran_lo

Welcome to uipath community

Use Assign activity

ListVal | Variable Type → Sysytem.collection.Generic.List<System.String>

new list(of string)({"apples", "orange", "pears", "berries"})


HI @cheeran_lo

You need to create a variable “FruitList” and “List 2” and browse for type list

then assign activity
FruitList= New List(Of String) from{“apples”, “orange”, “fruit”," fuit"," friuut"," pears"," berries"}

List2= New List(Of String) from{“apples”, “orange”," pears"," berries"}

String.Join(",",FruitList.Where(Function(x)  list2.Contains(x)).toList())

Hope this Helps!


Thank you. But I am using Process Mining App (Basic Connector) I cannot see this in the application environment. It looks more like studio to me if I am correct?