Need to put a validation like the quantity column should always be a number

I am entering a quantity field into the application from a source excel file.
I want to put a validation like the quantity should always be a number(decimal not allowed).
Since the file is manually prepared, chances of some human error like and alphabet crept in the qty column, etc. To avoid Uipath to abruptly stop, i would like to put a validation that the qty column should always be an integer, If not it will proceed to the next in the loop.

How do i achieve this validation in Uipath?

if you are using for loop to iterate through the excel values, you can put an if condition inside the loop.

if (excelcellvalue) you can verify using method – if(excelcellvalue.GetType.FullName) = System.Int32

then perform the validation

else part you can skip the validation steps…

thanks

small syntax mistake, just use this syntax.

thanks

Hi @Mallika,

Normally if you read the data from excel , it comes as string even if it is numeric. The way you proceed is right.

A small change. To take the value from datarow , we use “Item()” . In the Item property you can specify the column name or Column index (Index starts from zero).
Below I have attached a screen shot. it can help you.

image

Regards
Balamurugan.S

1 Like

Thanks a lot. This worked

Thanks for your response. I used Isnumeric condition and it worked.
Again thanks for your prompt response,

1 Like

Hi @Mallika,

If you think that you got solution , please close the thread as “Solution”.

Regards
Balamurugan.S