If statement - multiple conditions - wrong data returned

Hello,

I have an if activity, where I have two conditions. If the end date in my excel file is blank or has a value of 2099, T should be written in a cell. If the value is anything other than blank or 2099, F should be written in the cell.

When I execute the application
F is appearing in 2099 (It should be T)
T is appearing in blank cells (Correct)
F is appearing in cells other than blank or 2099 (Correct)

Could someone please help me fix my error so that T will also appear in cells with 2099?

Thank you,

String.IsNullOrEmpty(row(“End Date”).ToString) or row.item(“End Date”).ToString = “2099”

@MF.RPA

If you are facing any error, let me know, also share your sample data screenshot

Check below for assigning values to Datatable your reference
https://forum.uipath.com/t/tutorial-how-to-calculate-difference-between-two-time-values-using-uipath/247565/3

Also check by doing Debug, Place breakpoints to check the logic etc.,

Hope this helps you

Thanks

@ksrinu070184 The screen shot was provided above.

@MF.RPA

I see only workflow screenshot, I was asking you about your sample Data which means your Excel screenshot

Also any errors you are facing?

Thanks

@MF.RPA

Also try as row(“End Date”).ToString = "2099"

Hope this helps you

Thanks

1 Like

There are no errors, I am just not recieving the correct value when 2099 is present.

@MF.RPA
give a try on following just for analysis purpose:
(isNothing(row(“End Date”)) OrElse String.IsNullOrEmpty(row(“End Date”).ToString.Trim)) OrElse row.item(“End Date”).ToString.Contains(“2099”)

1 Like

This is the solution. Thank you for the help, I sincerely appreciate it.