How To Check If A String Is A Numeric – UiPath

Validations are something that we have to handle, while we are dealing with particular data.

Similarly in automation too, we check for different validations before performing any task.

Let us see how to check if the provided data is a numeric or it is not numeric!!!

_booleanResult = isNumeric(_input)

Note:
1. _input is the argument to the IsNumeric Function
2._boolenResult returns the true or false value based on the input


Example

Implementation using UiPath :

Let us implement a workflow which takes input from the user and checks if it is a numeric or not a numeric.

Step 1:
Drag “Input Dialog” activity into the design panel and try to save the user provided value into a variable for further operations.

UiPath Check if it is numeric 1.PNG

Step 2:
Drag “If” activity into the design panel and fill it with above-mentioned code.

UiPath Check if it is numeric 2.PNG

Step 3:
Drag two “Message Box” activities into the If activity and represent the appropriate messages.

Note :
“If” activity returns true, then “Is a Numeric”
else “Is not a numeric”

UiPath Check if it is numeric 3.PNG

Step 4:
Finally, let’s run the project

UiPath Check if it is numeric 4.PNG

Click here to download the Source Code…

Hope it has helped you…

Leave a Reply

%d bloggers like this: