cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Azure Automation Create Job Action - Passing a Boolean Exception Error

I am creating an Azure Automation Job in MS Flow.  My job uses a runbook with a parameter expecting a boolean value.  Flow is able to determine the parameter requires a boolean value and gives me a drop down list containing Yes, No and Custom value.  

 

If I select the Yes or No dropdown, Flow passes $TRUE or $FALSE value, but as a string instead of a boolean.  As a result I get an exception on my azure automation saying I'm trying to pass a string instead of a boolean.  

 

Cannot process argument transformation on parameter 'TestBool'. Cannot convert value "System.String" to type "System.Boolean". Boolean parameters accept only Boolean values and numbers, such as $True, $False, 1 or 0. (Cannot convert value "System.String" to type "System.Boolean".

 

If I select Custom Value and try to populate it with $TRUE or $FALSE - Flow reports that the value is not a valid boolean value.  Same if I use 0 or 1 (which is also valid in Powershell).

 

I have tested with multiple runbooks both in Azure and using Hybrid Workers with the same result.  

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
New Member

Re: Azure Automation Create Job Action - Passing a Boolean Exception Error

If you just type a 1 or 0 for the custom value it will be interpreted as a string value, hence the error.  Instead, set the custom value to the following expression:

int('1')

int('0')

that should work.

View solution in original post

3 REPLIES 3
Highlighted
Community Support
Community Support

Re: Azure Automation Create Job Action - Passing a Boolean Exception Error

Hi @kaband,

 

Could you please share a screenshot of the configuration of your flow?

 

Please take a try with the value true or false with Lower case letters to see if your problem could be solved.

 

Best regards,

Alice

Highlighted
New Member

Re: Azure Automation Create Job Action - Passing a Boolean Exception Error

If you just type a 1 or 0 for the custom value it will be interpreted as a string value, hence the error.  Instead, set the custom value to the following expression:

int('1')

int('0')

that should work.

View solution in original post

Highlighted
Frequent Visitor

Re: Azure Automation Create Job Action - Passing a Boolean Exception Error

Thank you Nirvy this was the solution.

Helpful resources

Announcements
FirstImage

Microsoft Ignite 2020

Check out the announcement of Power Platform content at Microsoft Ignite!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (9,287)