How to write if else condition

if some name exists in filename column then it has to execute one workflow or when filename column is empty then it has to excute anoher workflow so how to write if else condition for this?
excel 3 doubt

Hello @sathish_Kumar6 ,

Use For each and loop through the rows then
use the If Statement :
If(Not String.IsNullOrEmpty(row(“file name”).ToString))
in then Part you can execute the required flow which will execute only if file path is present

Else block you can add the other logic which will execute only if file path is empty

Regards,
Rohith

1 Like

checking if it is empty

String.IsNullOrEmpty(yourStringVar.Trim)
will return true when it is blank

When involved within a for each row loop
isNothing(row(“file name”)) OrElse String.IsNullOrEmpty(row(“file name”).ToString.Trim)

1 Like

hi i tried with If(Not String.IsNullOrEmpty(row(“file name”).ToString)) but this condition shows some error, so could u correct this please?

hi @ppr may i know how to implement this in my work flow i tried this but it shows some error
ppr

Hello @sathish_Kumar6 ,

2 Observations from the given screenshot.

  1. As you already used If block hence you don’t have to write the If condition again, re-write it as Not (String.IsNullOrEmpty(row(“file name”).ToString))

  2. ‘row’ is not declared, this is because you haven’t used the for loop outside. Use for loop as give n below :
    image

Regards,
Rohith

1 Like

thanks bro it worked and may i know to master if else conditions in uipath?

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.