Hello, I’m very new to UiPath so I’m likely missing something very simple here but I can’t figure out why it won’t let me convert the default string to Int32 in this case?
Hi @sean_styles, welcome to the Community.
If you have declared Invoice number of type Int32, just try:
CInt(Invoice Number)
Hope this helps,
Best Regards.
Try updating the variable type to string
Welcome to the community
As the name suggests…its get text…so the default varaible type should be text or string…you can then convert to integer as need using cint(variable)
Hope this helps
Cheers
Hi @sean_styles ,
Most cases when used Get Text
activity, we also get an error with types not being compatible with the extracted text, hence I think it would be better to convert/create another variable of type UiPath.Core.GenericValue
and then use this variable to perform a check to see if it is really numeric data and then convert it to Integer type.
Hi @sean_styles - Get Text
always accepts variable of type String
. Below fixes would help you
-
First Fix -
Convert.ToString(InvoiceNumber)
OR -
Alternate Fix - Change the variable type to
String
. You can edit this in the variables panel. Also,better change the scope of the variable to the higher scope to avoidVariable Not Declared
issues