Error madness with variable type

I had problems again with this activity.

I created this little workflow from converting months from letters to numbers (both them contained in a string).

Captura de pantalla 2023-12-14 153407

I wanted to pass the paramer getting it from the JValue, so I tried a simple .ToString. Studio kept complaining with such a stupid error message:

Captura de pantalla 2023-12-14 153345

Here you see the parameters of the “ConverTeixMes blah” workflow, with an exclamation on the “mesLletres” string input parameter (which is of JValue type), and then the next activity, below it, which is doing exactly the same without complaining about anything. And then, if you look for the newtonsoft.json.linq.jvalue methods, every reference says that THERE’S a ToString method, as expected (is it there any class without a .ToString??).

In the end, I had to use .AsText to get rid of this annoyance.

Doing a simple assign:


“Option Strict On disallows implicit conversions from ‘String’ to ‘Char’. The selected values is incompatible with the property type”.

I had to manually type that because it’s not possible to copy it from the message in pink background.

ArrayCarpetas is an array of String:

Carpetas is a String:

Why the error?

That is a Windows project. I have this other Windows - Legacy, I do exactly the same (no different types, no initialization, no other data manipulation) and there’s no error whatsoever:

Do you think we can have a normal workflow having to cope a handful of times per day with such inconsistencies and making Studio “validate” or “realize” there’s, in fact, no error?

This is incredible. I just showed this to my workmate. Have been messing with the activity since almast 9 in the morning; more than 2 hours. Deleting and recreating it; removing the variables and redeclaring them. Aplying all kind of tricks to Carpetas (like .ToString; absurd as it was already a String). Deleting and refilling the textinputs in the activity. I wrote the previous message out of desperation and frustration.

Then in front of her eyes I changed ArrayCarpetas(0) to [0], which is obviously wrong and it threay a further error. Then when I rewrote it properly again… the error was over!!

Now thanks to the mercy of Studio and UiPath I can continue programming, until the next annoyance.

@loginerror, you want us to keep a kind and happy tone in the forum, but… do you think that’s easy when you encounter such problems in your daily tool that prevent your work from advancing? Do you think that’s fair in such an expensive piece of software? For the sake of god, you gotta solve this once and for all. This is not even near alpha grade.

I tried to save the project. The project cannot be saved because it says it has errors (after converting it from Windows Legacy and him not being able to resolve all the activities to the new format). Apart from that being a hassle (what if I want to turn off the computer and continue tomorrow? What if there’s a blackout?),

…we are back to problems in the activities involved in my two previous messages you know why? Because Studio decided, on its own, to erase the “ArrayCarpetas” variable during the failed “save” attempt.


I redeclare ArrayCarpetas.
And then, back to this bullshit:


Point taken.

I wonder, could I get access to the zip of this project?

I would like to experiment with it a bit. Normally, when things like this happen, I would trim the XAML to just the corresponding bit, in this case just the assign activity.

For the record, I cannot reproduce this on a fresh Studio 2023.12 project with System 23.12.0-preview:

Remember this?

Apart from that being a hassle (what if I want to turn off the computer and continue tomorrow? What if there’s a blackout?)

This is what happened to me one second ago:

Without saving all the convertion work I alread did because Studio didn’t allow me to do so. And it happened when I wanted to start messing with the broken dependencies.

Thanks, UiPath.

Would you be able to list the steps you took for this to happen (in as much detail as possible)? Also, please always post the full error stack of those errors, it helps us triage them better.

As to the original issue, I was able to only reproduce it on a Windows C# project on my Studio 2023.12.0-preview. I then tried it on a developer build for Studio 2024.2.0 and it seems to be fixed there.

It is still unclear to me why the same would occur on the projects (which I think you are using). A XAML file with this issue would be appreciated (hopefully it still reproduces if you simply cut out that IF statement to a fresh XAML file and share that one, in case you cannot share the entire project). However, if it does not reproduce after placing the code in a fresh XAML, then the issue might be related to some other activities that are present in that XAML file (which would be a valuable discovery as well).

I’m on Studio 2023.10.4, Enterprise License (finally we “normalized” the license state across our machines, in respect to our number and type of licenses), User-mode installation.

The steps:

I spent the morning manually solving some unresolved activities after converting a project from Windows Legacy. When I was trying to solve a couple of non-resolved dependencies (in red) in the project, by merely placing the cursor over them, then it closed the editor and showed that error. I don’t remember if I even clicked over the red dependency. All my work was lost.

Would it be possible for you to share the original legacy project that was cleared of any confidential information?

We could then look into the areas that still require further improvements in terms of Legacy → Windows conversion.

If that is not possible, a list of the packages that become unresolved would also be helpful, but a project where I can hopefully break it the same way would be most appreciated.

My goal is to understand and help our Studio team fix these issues moving forward, as much as I understand how frustrating this experience can be right now.

Not exactly the same but I think it fits well in this thread.

Look at the screenshot:

I have an asset which is of text type. I retrieve the value; I store it in a global config variable. No complaints. “Config” is a dictionary of <String, Object>.

Then I do exactly the same below the previous one, with another asset (of the same “text” type):

Now I get the annoying “Option Strict On disallows implicit conversion from ‘Object’ to ‘String’". The selected value is incompatible with the property type”.

It fails randomly, and it seems when it does it’s interpreting the assignation in the wrong direction. I don’t want to assign a String to an Object. I’m assigning a String (the result of fetching the asset) to a variable of type Object.

Note also that the error gets “masked”, hidden inside the inputbox inside the activity’s properties, but not displayed on the activity itself.

When this happens, the only solution for me involves creating a new variable of type String, assigning the output of the Get Asset activity to it, then another assign activity to assign it to my Config variable:

Either I must have a very bad luck to experience this sort of problems all the time, but I can assure the people located physically near to me working with Studio suffer from the same all the time.

To prove the randomness of these behaviours:

After writing the “workaround” and documenting it here, I couldn’t resist trying to attempt one millionth more time the same I attempted before. Murphy’s Law cannot fail. And here you go:

No error whatsoever now that I’ve had to rewrite it “the assign way”.

To add some extra laughs (although it’s not funny in any way), having the original “defective” Get Asset below, I changed again the “kk” variable for the output to the Config one… And look, ma’! The error is there back again!

Exactly the same activities with the same settings, one above the other, one throws an error, the other one is fine.

PS: don’t get fooled by the name of the asset between brackets or not; it doesn’t seem to make a difference. Something that, by the way, also confuses the heck out of me and I don’t know how to control.

Captura de pantalla 2024-03-06 150056
Captura de pantalla 2024-03-06 150049


LAST EDIT: paying further attention, now using the asset name either as a String or as a “literal” (I don’t know how to call it; a literal asset from the list) seems to make a difference. Although, to my understanding, it shouldn’t affect the output assignation.


Well, now I don’t get to work getting the Asset name if it is a string. But note the previous Get Asset activity worked prefectly that way; the only difference is that it’s not in a specific Orchestrator folder:

The only way I get it working (direct out assignation to Config(“”) with an asset name as a String (“”) is by copying the 1st Get Asset (note that it doesn’t have a drop down but a “<>”) and replacing its contents.

PD: commenting the activity, using undo, redo, blah, doesn’t work, everything gets crazy. There’s threads for that. Are you gonna address this and the undo/redo bugs ever, @loginerror ? That’s a must.

For anyone reading this topic.

The latest issues listed here are not bugs, at worse they are features which are not clearly documented.

Lets first establish the basics.
Assets can be multiple types, text, integer, boolean and credential.
The Get Asset Activity will work for text, integer and boolean data types.

If you select an asset, via the dropdown menu, the output of the activity will match the data type of that object as that can be determined at design time, so if you have an integer asset the output will be an integer data type and you won’t be able to assign it to a string variable, which is entirely logical.

If you select an asset by using a variable or expression you cannot determine the data type at design time and so the output will be the generic ‘Object’ data type.

If you check above you’ll see the data typing issue occurs when the asset type is determined at design time and set as a string.

Nothing on this is random, instead its very clear, easy to understand and repeatable with valid compile errors when incompatible data typing is used.

Many activities have these dynamic outputs, and there is an argument to be had in saying this should be documented better in the readme pages, or the activity includes a dropdown for the data type which can be used to select the output type, similar to the For Each, where it is populated automatically but can be overriden or set when expressions are used, but there is no bug to fix in my opinion right now.

I’ve begged for this a million times. Is it that difficult to add the option to CREATE the variable of the PROPER OUTPUT TYPE in the activity itself? I’m sure I’ve seen before, either in Legacy projects, or either in SOME activities but not all of them.

It’s so difficult many times to figure out what’s the type of the output variable you should create. Sometimes I don’t see the type anywhere. It’s not stated anywhere, neither in the ¿documentation? pages. What sort of docs are those that are not even specifying the type of the parameters?? Sometimes I see the type in the properties or can infer them somehow. Then even after, suppossedly, choosing the proper type, which may turn so weird in a number of times, it still complains about not being the proper one:

Sincerily, I’m lost in these situations. It’s so frustrating I don’t know how to continue.

And it already took me a lot to find this “theoretically” proper type. Look at the list. Do you think this is normal?

Hombre. Por el amor de dios.

I already complained about thw so weird types of the Teams activities, with a cryptic name / hash in there / whtever:

Please. Don’t do that. Fix it. For god’s sake.

Have you tried using the shortcut ctrl+k to create the variable?

1 Like

Thanks a lot, @efelantti . For some reason I didn’t know this one. As in some activities the “create variable” is available from the GUI, and in others it isn’t, I took for granted it wasn’t available, apart from not knowing this shortcut. I’ve tried it in and it works even if the GUI option is not there. This is of great help; it will save me a lot of work and hassle. Many thanks!!

Noone from the staff pays attention to this neither gives a damn to this thread.

Look at the error. It happens randomly. Look, “exception” var is of type Exception. Look at the list of variables. Everything I’m trying to assign to variables in the Multiple Assign are text and/or integers. But has to throw up that stupid "Cannot assign from type ‘System.Object’ to type ‘System.String’. Where is that happening, UiPath? Can you at least tell me where? Can you have that deference? If it’s in a specifing assignation, let me know which one. Every 2 minutes you get a randome bug like this one. It’s impossible to work under these conditions.

To prove that I’m not crazy or lying, either:

That’s the original activity, from the previous comment screenshot.

This one contains exactly the same Multiple Assign right below the other, after I got rid of the stupid error after a million combinations. Copying and pasting the “original” Multiply Assign worked when it wished to, also.

Exactly the same information. Exactly the same content in the activity.

One hour to make it work, two posts in the forum, one open ticket with a follow-up with extra information (this one). No reply yet.