I would like to compare the 2 data tables. But the issue is in 2nd data table, header values changes dynamically. Like column1 = “Users” but sometimes it will have headers as Column1 names “Users Name”
Due to this for each throws error. Is there any option to compare the datatable with dynamic headers? is it possible to use contains for the headers?
Like my first datatable has 5 columns namely Users, Age, DOB, Place.
my second datatable has 5 columns namely
Users, Age, DOB, Place.
Users will sometime change the header name of the second datatable to:
Users name, Age, Place of birth, DOB.
So in order to compare with the second datatable columns is changed due to that it throws error and also some column name position is also getting changed.
My point is, is it possible to compare these two datatables using .contains methods on column headers?
Once I had the same issue. There are 2 solutions:
1.You need to create dictionary (or something else if you want) of possible names and then iterate through columns via “for each” activity and match dict with current col name to find which names are in use this time. Use regex to search more flexible way if possible names have no finite number
2. While you search names you need remember indexes of columns and then operate with indexes not names.