How to convert a DataTable to Dictionary in UiPath

Converting a data table to a dictionary is always a useful method to read the excel and use that in the whole process.

In this post we will see how we can achieve that using a LINQ Expression.

First, we have to create a data table or you can read an excel file and create a data table from there.

Create a datatable by using this Activity : Build Data Table as follows

Now create a output for this activity as DT in this example as follows.

Now create a Dictionary variable as shown below:

This will be the main part where we are converting a DataTable to Dictionary using LINQ Expression.

Write the LINQ query as shown below:

This is the Output after you implement everything that is mentioned above

That’s it for this post of converting a data table to a dictionary in UiPath using LINQ Expression.

Happy Learning!

Like this post then let your friends know about this-:

Leave a Reply

Your email address will not be published. Required fields are marked *