How to pass string value in integer import arguments

Hi All,

As i am new to RPA , will need your help to resolve my issue,

My out argument from 1st sequence having integer type ,
In second sequence i created one variable as string type
As i am passing second sequence variable to an integer argument
In second sequence i am using invoke workflow activity in which after import arguments i am getting error for value .

Error:
Compiler error(s) encountered processing expression “intFinalSalary”.
Option Strict On disallows implicit conversions from ‘String’ to ‘Integer’.

Thanks in advance :slight_smile:

Hi @amruta_pawar

First of all, Welcome to the community!! :smiley:

So, your problem is, it cannot automatically convert the string value to an integer. To do that, you can use the below command to convert the string to and integer.

Assuming your String variable is Var1

Int32.Parse(var1)

This will convert the string value in Var1 to integer

Let know whether this helps!!

If this works, please make sure to mark the answer as the solution too :slight_smile:

2 Likes

hi,

You can also try “Convert” method to change your value to desired datatype as shown below.

Thanks,
Sid

HI @amruta_pawar

You can use cint(yourvariable) to get the integer value.

Thanks

Hi @Lahiru.Fernando

Thank you so much,

I am still getting error while assigning value to imported argument as ‘invalid L-value expression’

Hello Amruta,

From the times I have gotten those, it is generally because the value was not declared initially. I would double-check to make sure that the value exists and isn’t Nothing.

I am getting error while assigning value to imported arguments.

@dmccammond thank you ,but i created variable which i want to assign to imported arguments in invoke workflow activity

Right, I think I get what you’re doing. I am guessing that you’re not actually importing a value for the argument which is causing it to not have an initialized value. Double-check your invoke’s arguments to make sure that you’re passing something. Also, make sure that what is being passed is an initialized variable.

1 Like

thank you @dmccammond at the time of initialization i am changing it type and now its working.

1 Like