How to write if sequence if specific cell exists?

Hi, I am new to uiPath. I am trying to write an if statement that if a value in an excel box exists, to show message “Customer has been billed”. The value is a date in the excel file that proves the customer was billed. For some customers, there is no value, hence I would write an if statement that “Customer has not been billed”

This is the link to the excel file https://docs.google.com/spreadsheets/d/1R3oQzv3ITf4fXR-uXpgWHZtk81gh_led/edit?usp=sharing&ouid=104054591438406330937&rtpof=true&sd=true

This is the link to my uiPath Studio project. The beginning is where I need help https://drive.google.com/file/d/1m4JzDH-NLwYbWUkASTzewXwk03n2169k/view?usp=sharing

Hi @Jimmy_Singh

  1. Read the Input excel file. store it in the DT variable.

  2. Use For each row in DT and if activity
    image

This the code need to modified

Regards
Gokul

1 Like

Hey Gokul. I am getting the error Error: ERROR Validation Error Compiler error(s) encountered processing expression “CurrentRow(“Billed”).ToString=”“”.
‘CurrentRow’ is not declared. It may be inaccessible due to its protection level.

Hi

You are almost done

Mention the condition like this in if activity

NOT String.IsNullOrEmpty(CurrentRow(“Billed”).ToString.Trim)

If true it means there is a value and it goes to THEN Block where you can write as

Or it goes to ELSE block

And this error came because your for each row activity will have a variable in it
Either as row or CurrentRow

If it’s row then the condition will be like this
NOT String.IsNullOrEmpty(row(“Billed”).ToString.Trim)

If it’s CurrentRow then this
NOT String.IsNullOrEmpty(CurrentRow(“Billed”).ToString.Trim)

As simple as that

Cheers @Jimmy_Singh

1 Like

Thank You for your detailed response.Now I am not receiving an error after entering: NOT String.IsNullOrEmpty(CurrentRow(“Billed”).ToString.Trim) but I am not receiving a message box when I run the file.

I got the first row to work for M1:M2 but when I do M3:M3 in the read range, I don’t get a message box

  • You can use the For each row in Data Table variable “row”

Regards
Gokul