IF condition error while using single boolean variable

@suresh_kumar4 row_main(6).ToString and try

Ok as a simple test can you use just the first foreach loop and within that use the WriteLine to print the values:

row_main(0).ToString

Please run it in debug mode and check what the data table variable is before the for each row gets executed.

i am getting data what is there in excel

@suresh_kumar4 Now can you put – row_main(6).ToString in ur for loop and execute
and try what value you are getting.

your first cell in excel is blank that is the reason it showing blank

here i am doing for each

row_main(0).ToString.Contains(“VESSEL:”)
did you try this?

Thanks for your reply! no it does nt work

Main.xaml (147.2 KB)

this is my xaml file can any one check where i went wrong

Thanks,
Suresh.

@suresh_kumar4 Did you used .Contains(“YourString”)

Have you tried to modify the code with this:

  1. Assign activity before IF statement strMyString = row_main(0).ToString.Replace(" “,”").Trim()

  2. THEN in IF Statement:
    strMyString.Contains(“VESSEL:”)

if possible, Can you share the excel sheets you are using in the code.

sorry its confidendial…

are you sure is this the string you are checking “VESSEL:”

Yes i found the error why i am getting wrong result here…because while looping in for each its checking from the first row… here my record is in 7th row …so while looping if the first row is empty then its going else part and updating the result as false.

so here what i need is while getting exact match only the result should update to my excel…if false no need to update.

Thanks,
Suresh.

cheers @suresh_kumar4

now what i want is if my data is not present i want to update False in my excel sheet…

here when i put false in the else part while checking the 1st row itself its updating as false in my excel
sheet.

so if data is not present i want to update false in my excel…

Thanks,
Suresh.