Default value for boolean argument in invoked workflows aren't respected


#1

Hi!

I have two workflows.

The first workflow is a simple message box that show the value of the IN argument boolean.

This first workflow is called upon by my second workflow. If I edit Argument and provide either True or False to the IN boolean, the message box show either True or False when running.

However, if I set a default value on the boolean in my first workflow and doesn’t specify any value when I call upon it, it has no effect. The value always comes back as False when called upon by my second workflow.

I have no problem using default values with string arguments. What’s going on here?

Why aren’t default values for booleans arguments respected?


#2

@isakd Could you please share your sample workflow to check. Ideally should not be a problem using default values(with any data types) in arguments, provided the values in arguments are passed correctly from first workflow to second one.


#3

I can’t attach files yet.

I’ve uploaded them to wetransfer two workflows


#4

Hello @isakd,

It is working as expected because the default value for a bool variable is false, which means if you don’t explicitly specify the variable value it remains as false. Also, it does not depend on whether or not you calling another workflow or not. Even in the same workflow, if you don’t specify the boolean variable value and try to print it, it will come as false.

Refer to this link for default values.


#5

Intresting. I had no idea. This answers my question perfectly.

The “Default value” field in the arguments panel are a bit confusing if you don’t know this :slight_smile:

Thanks!


#6

Hello,

I have the same issue. When returning a boolean value from “Invoke workflow file” i only get “False” even when the value in the “Invoke workflow file” is “True”.

Could you share how you solved this?


#7

According to Prakshi_Tyagi it’s not solvable, you just have to work around it.

An UiPath developer I know IRL tells me this sounds more like a bug than a feature, but as long as you are aware of how it works you can probably work around it.