How to give column name in If condition

Hello I have data sheet which contains information with four column names. ex A, B.C D. But I need only column B. if it found then run the activity using column information. please advise me with condition.

Hi @ks185332,

use Read CSV activity to get the sheet data to the datatable.

In If conditions dtOutput.Columns.Contains("B")

Regards,
Arivu

image getting this error.

Hi,

Give default value of datatable variable as New Datatable

Regards,
Rahamat

Hi @ks185332 ,

Datatable should not be null/empty, after reading CSV sheet check it.

Regards,
Arivu

image
please correct it

Hi @ks185332,

Condition is correct only, check read csv activity
Please verify in csv data is available or not.

Regards,
Arivu

imageit is there

Can you send the xaml file.

Please verify Read Csv activity in property output you given datatable or not

yes i 'hve given the variable name in output

@ks185332, can you try this ?

(From col in dt.columns.cast(of system.data.datacolumn) select Convert.ToString(col.columnName).Trim).Toarray(). Contains ("Recommended Action")

Regards,
Dominic :slight_smile:

@Dominic Hey M still getting this imageplease help me.

@Dominic please check this and correct me if anything wrong or needs to be change…
image

@ks185332, Check your datatable. It seems to be empty ? can you share xaml if possible ?

Regards,
Dominic :slight_smile:

1 Like

test(Autosaved).xaml (72.3 KB)

image

Hi @ks185332,

Please remove the unwanted (duplicate) Data table and Generic Variable

Dt1 and RA (same variable present in the scope → Body And test )

Regards,
Arivu

1 Like

yes seems working thank you.

@Dominic Can you help on how to consider only one Excel/CSV column into a variable. ?