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


#1

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?


#2

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


#3


#4

small syntax mistake, just use this syntax.

thanks


#5

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


#6

Thanks a lot. This worked


#7

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


#8

Hi @Mallika,

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

Regards
Balamurugan.S