Join DataTable by Passing Key Columns through Config File

Dear Forum Members,

I am working on an automation solution where I need to do left join on 2 Datatables and key columns should be dynamic. For e.g., if I pass 1 key column in the config file, it should join the tables on that 1 key column, if I pass 2 key columns, it should join on 2 key columns and so on.

I have tried using for loop and append the output but in the case if column count is different, Append will not work properly in that case. Also, in append, I am not getting the headers. I can’t define the headers because it will be different in every file on which this will be executed.

I have tried taking the key columns in an array on which join should be performed but I can’t pass the array in Join data table. And not sure if this can be achieved using LINQ query.

Kindly guide me to solve this. Thanks in advance.

Hi @dimple.khurana ,

Maybe we could try Combining the values of the columns that are needed to considered for joining into a Single column value and then perform the Join on those Merged Column of both Datatables.

Could check the below post on the implementation and then perform Left Join using Join Datatables activity :

Hi @supermanPunch ,

Thanks for your reply. I had checked the post you shared but this is not what I am looking for. I want Left Join on 2 Data tables with dynamic key columns. With UiPath Standard Join Datatable activity, it is not possible. So, I was trying with LINQ to create a dynamic solution.