If else not working for empty cells or 0

Greeting,
Im having problem with my workflow which output is logical error.
The process should be where (IF → cells empty or 0 → “No match”) (else → “Match”)

I use IF Else with Expression (gotah2 is Nothing OrElse gotah2.Rows.Count=0)
“gotah2” is variable.

I also use filter datatable which remove column (gotah2.Columns(0)) = “0”) but somehow not remove it.

Inside excel have few cells with “0”. However, the bot still go “Match” even the cells stated 0. Appreciate the guidance and simple solution.
image

Files as below (0 started on cells 300 due to read write from previous workflow)
test4.xlsx (13.9 KB)

1 Like

Can you please show us what data you are trying to dump into the datatable? @DTECH

It’s just date that match from previous excel. The previous excel have formulated cells which “empty, 0 or date”.

So, Basically you want Condition Like
If Column(0) has value as “0” or Column(0) is empty than it should “Not Match” Else “Match”?

or Do you want to remove Column if Condition is “Not Match”?

This one Im trying to solve, sorry for confusion.

Try Below Expression in For each row and Let me know if It is Working.
string.IsNullOrEmpty(CurrentRow(0).ToString) or CurrentRow(0).ToString.Equals(“0”)
Than → “Not Match” Else → “Match”

So sorry, my workflow cannot work if using “for each row” for that part. I try to keep it simple with using IF else method. Maybe can you suggest simple workflow that eliminate 0 in cells. Because my “IF Else” used to work if cells is " " but doesn’t work if contain 0. Can refer test4.xlsx above. I also try using filter datatable to eliminate 0 but doesn’t eliminate 0.

image

Hello @DTECH
Pass this Condition in Filter DT.
Screenshot (63)

Hope this helps.

Regards,
Saloni

Hi, I did try but 0 still appear.
image

Here are the targeted files.
test4.xlsx (13.9 KB)

Refer this .xaml File.
Testing.xaml (8.4 KB)

Hmm that’s weird, it works when using your workflow. The different is I’m using read range inside excel scope and somehow it doesn’t remove 0. Anyway I will try implement this on my part and see how it goes. Thanks :smiley:

Hi, I realise the filter is using Column0 → contain → “0” instead “=” → “0”. I wonder what are the cause for that. Because if the cells contain 1234.00, it will remove for sure.

Hello @DTECH
Refer this .xaml File.
Testing.xaml (9.7 KB)

However it is getting 0 as Double from Excel file So i Converted it to Integer type and it is working fine with = now.

And there is no issue if you are using workbook or Excel scope, This is Working fine with Both the Activities.

Hello @DTECH
Is it working Fine now?

Yeah its working now, thanks a lot. Also I found another solution that convert to General in cells format fixed the issues too. Appreciate the helps :smile:

1 Like

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