Lesson 3 practice 2 assigning issue


Hi All,

Trying to do Lesson 3 Practice 2


and I get an error message when I try to assign a string to a generic variable


Says "Cannot assign from type System.string to type UiPath.Core.GenericValue’ in assign activity.

I thought that the point of generic variables is that they can take any type so shouldn’t this work?

I’m probably doing something very silly but can’t see what so any help would be greatly appreciated.

I’ve attached the xaml file if that helps.

Many thanks,

Main.xaml (7.2 KB)


Hi @charliefik,
you can assign the value to Generic variable like below



@charliefik, I just deleted the value from the assign activity and added it back. It worked and i was not getting the error again.

Rammohan B.


Yes @Rammohan91 is also right. It is also working…


Thanks very much for that fix.
So to confirm my understanding, basically what I was doing was correct there was some mysterious reason that it wasn’t working and deleting and then putting it back exactly the same way fixed it? That seems like a nightmare debugging situation if the fix is to do exactly what you were doing already how can you understand what you are doing wrong? Just trying to get my head around how to fix stuff in the future that may not be as simple.



Thanks for the suggestion about converting the string to a generic type but surely the point of a generic type is that you can pass anything to it and it doesn’t need to be converted (or am I not understanding properly)


Hi @charliefik,
Take a look



Thanks for the link Balamurugan. I looked at the information (which I thought confirmed what I believed, maybe I’m still wrong?) but my point was that if I am passing string data to a generic variable I shouldn’t have to convert it (as you suggested) to a generic type before assigning it to a generic variable (as it should accept any type).


Hi @charliefik ,
Yes . it accepts any type variable. but have to remind the red block.


better when assign the Generic variable to a variable .we can have to convert it like




Yes very good point thanks for the clarification. Although in this specific case I think the problem was slightly more mysterious (as deleting and replacing with exactly the same ‘code’ fixed the issue) but I will definitely bare that in mind going forward.

Thanks very much


Hi @charliefik
Ok . All the best to clear all exams with certifications.