For each row in modern design

Hi All,
I have a datable in that i have marks column i want to check the who got less than 70. When i try to do it’s throwing an error, can anyone guide me.

What i did is

Val1 = currentrow[“marks”].tostring()

If – convert.toint32(Val)<70

But it is giving me an error – input string was not in correct format

I’m using C#

@Learner007

First you have to check if it is a number or not …May be datatable has blank cells

Try val1.Trim.IsNumeric AndAlso convert.toint32(Val1.Trim)>70

This will first check for numeric and then try to compare

cheers

Hi @Anil_G This is showing error after convert I’m not getting toint32 - I’m using C# -modern design

Hi,

How about the following?

Int32.TryParse(Val1.Trim(),out i) && Convert.ToInt32(Val1.Trim())>7

Regards,

1 Like

Hi,

Can you define i as Int32 in variable panel?

Regards,

Thanks @Yoichi it worked. Can you suggest me which is the best tutorial to learn UiPath Modern design because i haven’t worked on this before some difficulty I’m facing here.

@Yoichi for everything it’s going to else only even less than 70 also it is going to else only

Hi,

For now, can you check content of Val1 using LogMessage or MessageBox etc?

Regards,

I have the column values in 0.95 format

I have written same condition in IF instead of 7 i wrote >0.70

In this case, we need to use Double, as the following.

image

Double.TryParse(Val1.Trim(),out d) && Convert.ToDouble(Val1.Trim())>0.70

Regards,

1 Like

Thanks @Yoichi this is working. If you don’t mind can you tell me what is the difference here for int and Double, my value is already numeric right.

Hi,

int type can accept only integer. This means it doesn’t accept decimal (point) like 0.7.
Double can handle decimal like 0.7
There are several numeric types in .net. The following document might help you to understand each types.

Regards,

1 Like

Thanks @Yoichi i will go through that topic once

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