Bug in UiPath Studio: Variables and Arguments are allowed to have the same name

  1. Create a workflow, say bug.xaml
  2. Create an output argument say “Arg1”
  3. Create a variable named “Arg1”
    In the workflow, assign “Bug” to Arg1.
    You will notice that the variable Arg1 will now have the value “Bug”, not the argument named “Arg1”.

So there are two things going on here.

  1. UiPath is allowing both variables and arguments with the same name
  2. When you assign a value, the variable is taking precedence.

This is leading to serious bugs. I created an workflow to return a database connection to an argument that I created “DBConnection”. Inadvertantly, I had created a variable also of the same name.

When I used this, it was not returning the Database connection object. It was returning null.

We already have a workflow rule for this (st-nmg-006). I recommend you enabling the analyzer execution. You can even configure it as “Error” to ensure your execution is blocked if you have a name collision.

Thanks for pointing this out. It is helpful for the interim. But why make this a warning and not an error (that cannot be changed to warning) It should really not up to the developer because it causes serious bugs.