How To Convert List To Array In UiPath

Converting one datatype to another is one of the most common things we do in programming.

Let’s see how to convert a list to an array and Vice Versa…

1. Convert List to Array
2.Convert Array To List


1. Convert List to Array

our_Array = our_List.ToArray

Example:

Implementation using UiPath :

Let us implement a workflow which converts “List” to an “Array”

Step 1:
Create variables as shown below

UIpath Convert list to array 1.PNG

Step 2:
Drag “Assign” activity into the design panel and initialize the list of string type.

UIpath Convert list to array 2.png

Step 3:
Drag another “Assign” activity into the design panel
Use the above-mentioned code and its done.

UIpath Convert list to array 3.PNG

Click here to download the Source Code…


2. Convert Array to List

our_List = our_Array.ToList

Example:

Implementation using UiPath :

Let us implement a workflow which converts an “Array” to “List”

Step 1:
Create variables as shown below

UIpath Convert list to array 1.PNG

Step 2:
Drag “Assign” activity into the design panel and initialize the Array of string type.

UIpath Convert array to list 1

Step 3:
Drag another “Assign” activity into the design panel
Use the above-mentioned code and its done.

UIpath Convert array to list 2.PNG

Click here to download the Source Code…

Hope it has helped you… 

 

 

Advertisements

Author: Sharath Raju

Founder@www.ExcelCult.com

One thought

Leave a Reply