cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
kaband
Level: Powered On

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
nirvy
Level: Power Up

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
Community Support Team
Community Support Team

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

nirvy
Level: Power Up

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

kaband
Level: Powered On

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

Thank you Nirvy this was the solution.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,534)