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.