How to give column name in If condition

activities

#1

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.


#2

Hi @ks185332,

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

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

Regards,
Arivu


#3

image getting this error.


#4

Hi,

Give default value of datatable variable as New Datatable

Regards,
Rahamat


#5

Hi @ks185332 ,

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

Regards,
Arivu


#6

image
please correct it


#7

Hi @ks185332,

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

Regards,
Arivu


#8

imageit is there


#9

Can you send the xaml file.

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


#10

yes i 'hve given the variable name in output


#11

@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:


#12

@Dominic Hey M still getting this imageplease help me.


#13

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


#14

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

Regards,
Dominic :slight_smile:


#15

test(Autosaved).xaml (72.3 KB)


#16

image


#17

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


#18

yes seems working thank you.


#19

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