How to create an enum

I cannot find anywhere online that shows how to create an enum in UiPath for example a List of type string is in this format New List(Of String)(new string(){“text”})
Is there similar for creating an enum?
Thanks,
Monica

Hi @monica.ryan

Go to variable and change the type as system.enum

Thanks
Ashwin S

You can append .AsEnumerable to convert to enumerable. It looks like in your example though, you havea list of string, but then provide an array of strings so there may be a syntax error in your example, perhaps you wanted New List(Of String()) instead?

Hi @AshwinS2 I have an empty variable as System.Enum and I am looking for what to populate it with,
Thank you

Hi @Dave
Apologies, yes in my example it is an array list of strings, I just want to create an enumerable in the similar format, I am not looking to convert an existing variable,
Thank you

Hi @monica.ryan
Use ienumerable var={“test1”,“test2”}

Use for each item

Print the item

Thanks
Ashwin.S

Hi @AshwinS2
Apologies but I still cannot figure this out, UiPath and vb .net are both new to me.
Could you explain further?
Thank you.

Hi @monica
Create a variable as enumvar in variable pane and variable type as system.collections.ienumerable and pass the values inside as {“value1”,“value2”}

And do the manipulations

Thanks
Ashwin.S

2 Likes

Hi @AshwinS2
Thank you for that, I can now create an IEnumerable variable, however how do I convert this to a System.Enum which is the variable that I need,
Thanks,

Monica