Check a column exists in a datatable or not

Hi everyone,

My requirement is i extract a name from subject of the email and add to existing datatable using add data column activity after that i have some comparing between datatables , My issue is when there is no name in subject of the email i dont use add datacolumn activity , but when comparing it causes issue , saying column not found

Is there any way where i check if a particular column data exists for eg : i am checking row2(6) where ‘6’ column is not present

Thanks in advance

2 Likes

Hi Kavya,

Please check this.

It has solution.

Hi @kavya.s16

If you know your column name try using the below statement in IF activity to identify if the column is present or not

In IF Statement use YourDTname.cloumns.contains(“CloumnName”).

Hope this helps,

Thanks.

3 Likes

hey,

if you are using index for your columns, you can check first the lenght of the column with yourDt.ColumnCount, else if you know the name on the column use Dt.Columns.Contains(“stringText”)

regards

thank you it worked

Glad that worked.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.