Compare header Names of 2 datatable

Hi team,

Can anyone tell me how i can compare headernames of 2 datatable.
Both of them contains 54 headers.
If there is a mismatch in headernames then BOT will throw Business exception

Hi Zara,

Try this


Hope it will work

tried…but its picking only first header name…i want to match all 54 with the another 54

then You have to use nested loop for this. Let me show

1 Like

if u have any reusable code for this…pls share

with following statement you will get the column names as list:
YourDataTableVar.Columns.Cast(Of DataColumn).Select(Function (x) x.ColumnName).toList

with the data set operations you can identify if its matching or not e.g. with intersect or except

Hi Zara,

Quick solution.

Cheers Sequence.xaml (10.4 KB)

1 Like

find starter help here, using the set operation approach
Check_2DT_hasSameColNames.xaml (11.8 KB)

1 Like (13.4 KB)
Please find the attached workflow file.
Hope It can help. Mark as solution if it works

1 Like