String to Integer error


Using OCR and string manipulation I’ve managed to get my variables filled with numbers from my (Pipedrive) variable element page.

My last task is to convert the String to a Int so I can sum them up and let them be filled in in my Excel file.

How can I convert a String to a Integer?

I am now trying a Assign with ro1Result (thats the string that needs to become a int with the following line Convert.ToInt32(ro1Result.TrimStart) but I’m getting a error with that (Opstion Strict On disallows implicit conversions from Integer to String)

what is the data type of ro1Result. Seems it be it is already an integer type.

Currently it’s a string

Hi @devopsnr
I think you need to have already an int so you can assign the converted integer in it, so ro1Result must be an int

1 Like

Int value = Convert.ToInt32(ro1Result.TrimStart)

I think your LHS is a string, you ll need to set it as integer to store integer value.

Check the variable type in the Assign Activity. Change to INTEGER if not.

Use IF activity with Integer.TryParse method to make sure you extracted proper data from OCT :grinning: