Problems with converting asset of type Bool to boolean

Hi guys,

Another interesting query here.
I have an asset of type Bool, I load it to workflow using GetAsset. Not surprisingly, I cannot assign the value directly to anything else than a variable of datatype GenericValue. Later, I want to check the value in Flow Decision passing: “var.toboolean=true” but it throws following error:
argument not specified for parameter provider of public function toboolean (provider as system.iformatProvider) as boolean
I also tried convert.toboolean(var) - error I’m getting then is:
Overload resolution failed because no accessible toboolean is most specific for these arguments:
‘Public Shared Function ToBoolean(value as Date) As Boolean’: Not most specific.
and so on for other types of values

In the end I settled for var.toString=“True”, but that’s stupid, whole point of having Bool is not using it as a string, otherwise why having Bool in the first place

Any ideas why is it so?

@salladinne

As far as your asset is set as Boolean and your target variable is Boolean too, it should not be a problem. I tried with both values and the result was as expected.

Doesn’t work for me - screenshots below

@salladinne

Might be a mess with UiPath refreshing your variables. Try delete the output variable from the activity, save, type the variable name again.

@msan
Did what you said, unfortunately didn’t help. I am attaching the workflow
CustomerSetupProcess.xaml (149.9 KB)

It’s the GetAsset activity in Add New Customer flowchart

@salladinne

I Deactivated the Excel scope and replace the IsItaly variable.

CustomerSetupProcess.xaml (143.3 KB)

Thanks msan
It is working - still not sure why didn’t work in my workflow, but I guess we won’t find out :slight_smile: Marked as solution

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.