Hi Guys,
row_main(0).ToString.Equals(“VESSEL:”) i am getting this from excel below is my flow and i have used single boolean variable for all the if conditions…here i am getting false for all the if conditions
i am getting false when i check in message box here but it goes to then loop
Thanks,
Suresh.
1 Like
SowmyaLeo
(Sowmya Sivakumar)
February 10, 2020, 9:17am
2
@suresh_kumar4 :
If a condition is false, the then loop is executed. Which is correct.
Only a true condition will result in the if block.
I think you need to check if the column does not contain VESSEL:
If so please try the condition:
Not row_main(0).ToString.Equals(“VESSEL:”)
samir
(Samir Mohite)
February 10, 2020, 9:18am
3
Hi @suresh_kumar4 ,
If you’re expecting Then section to execute, then i’ll suggest you to use .Trim here aswell.
try following condition.
row_main(0).ToString.Trim.Equals(“VESSEL:”)
row_main(0).ToString might have leading Or exceeding white spaces.
Thanks but It does’nt works for me
Adding UpperCase if ever:
row_main(0).ToString.Trim.ToUpper.Equals(“VESSEL:”)
thanks for your reply if i use NOT i am getting true… but i have vessel in my column…
can you check whether the data in excel is in the same Case you used in the code.
COmparing sting are case sensitive. In order to pass the condition both has to be identical
SowmyaLeo
(Sowmya Sivakumar)
February 10, 2020, 9:26am
9
@suresh_kumar4
Please use a Write Line activity with row_main(0).ToString and check what the result is. Kindly do this before the If block.
GBK
(GBK)
February 10, 2020, 9:32am
12
GBK:
row_main(0).ToString
you can log “row_main(0).ToString” this value before if condition and check what is the value and apply the conditions accordingly…
row_main(0).ToString.ToUpper.Equals(“VESSEL:”)
row_ConfiguFile(“VESSEL:”).ToString.ToLower.Equals((VesselText.ToLower.Trim()))
row_main(0).ToString.ToUpper.Equals(“VESSEL:”) problem is here
row_ConfiguFile(“VESSEL:”).ToString.ToLower.Equals((VesselText.ToLower.Trim())) this one is fine.
@suresh_kumar4 can you print the value in log and check what value you are getting in the row_main(0).ToString. because as per my understanding you are not getting any value over there that is the reason it’s failing.
GBK
(GBK)
February 10, 2020, 9:34am
15
suresh_kumar4:
row_main(0).ToString
Add a Log Message Activity before the If condition and write the value of row_main(0).ToString
SowmyaLeo
(Sowmya Sivakumar)
February 10, 2020, 9:36am
16
@suresh_kumar4
I think the row you are trying to get the data from is not correct. Can you paste the screenshot of the for each row activity used on the dataTable.
i am not getting value you are right but value is there in excel.
SowmyaLeo
(Sowmya Sivakumar)
February 10, 2020, 9:43am
19
From the excel screenshot I see the first row was blank.
VESSEL: is an entry in the second row.
1 Like