How to convert STRING into GENERICVALUE?

Hi There,

I want to convert String Value = ‘1000’ into GenricValue.

How to achieve this ?

grafik

1 Like

Hi @Muralikrishna_Surve

Try with this syntax

GenericValueVariable = StringVariable


GenericValueVariable = CType (StringVariable, GenericValue)

Regards
Gokul

Hi @Muralikrishna_Surve ,

I believe we can directly assign the value to a Generic type variable :
image

Could you check and let us know if this is what you require ?

Hey, @Muralikrishna_Surve
image

Hope this helps

Regards.

Yes,

But here There is StringVariable already created.

I want to convert that existing StrVar into GenericValue.

@Muralikrishna_Surve , You can use the Assign activity or the CType function to convert a string variable to a generic value variable in UiPath.

if you have a string variable called StringVariable, you can use any of these expressions:

• GenericValueVariable = StringVariable

• GenericValueVariable = CType (StringVariable, GenericValue)

Regards
Gokul

@Muralikrishna_Surve ,

If you do not need to create a Generic Value type variable and assign the value to it, then I believe the suggestions are already provided above by other users for the conversion part, use the string variable instead of the hardcoded value. It should work.

Or

You can just change the existing string variable type to GenericValue and check if that is what you require.

Yes.

Thanks alot for your efforts.