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

Sharepoint List Item boolean not working in Azure Automation

Hello together,

 

i have some problems while Running an Azure Automation Runbook.

If have a powerapp which fills out a Sharepoint List with some Data. 

And with flow i check if there is a new List item created then the approval starts and after that the Azure runbook is starting and get all needed Paramters from Sharepoint List.

 

it looks like this:AzureAuto.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

This is working perfectly and the script in Azure Runbook receive all parameter.

 

But for the 2 booleans (in sharepoint list yes/no items) the script says cannot convert system type string to boolean. 

Why is the yes/no item from Sharepoint list a string not a boolean? 

 

Can anyone help me here?

 

Thank you in advance.

 

Best regards

 

Michael

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: Sharepoint List Item boolean not working in Azure Automation

Hi @FlyingM,

 

Could you please share a full screenshot of the configuration of  Azure Automation action in your flow?

Could you please share a screenshot of the run history when the flow run failed?

 

Does the 2 booleans column that you mentioned in sharepoint list are the "Yes/No" type? Could you please share more details about the 2 booleans column?

 

Best regards,

Alice

Highlighted
Regular Visitor

Re: Sharepoint List Item boolean not working in Azure Automation

Could you please share a full screenshot of the configuration of  Azure Automation action in your flow? ->

 

AzureAutoFlow.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Could you please share a screenshot of the run history when the flow run failed? ->

 

The Flow run is running successfully but, the script failes because the yes/no column from sharepoint is transmitted as string not as boolean. So i receive the following error message in my azure automation runbook:

 

 

AzureRunbookFailed.png

 

 

 

 

 

Sharepoint list is yes/no type - looks like the following:

 

image.png

In my Runbook i run some commands only if the yes/no type is true.

 

Swyx User means a new user for our telephone system

Preprod means if its true the user will be created in the OU Pre production for testing.

 

Here is the runbook parameter set:

param (
 [Parameter(Mandatory=$true, HelpMessage = "1Enter the givenname of the user you want to create.")]
 [string] $givenName,
  
 [Parameter(Mandatory=$true)]
 [string] $surname,
  
 [Parameter(Mandatory=$true)]
 [string] $department,
  
 [Parameter(Mandatory=$true)]
 [string] $title,
  
 [Parameter(Mandatory=$true)]
 [string] $description,
  
 [Parameter(Mandatory=$true)]
 [string] $Password,
  
 [Parameter(Mandatory=$true)]
 [int] $internaltelephonenumber,
  
 [Parameter(Mandatory=$true)]
 [ValidateSet("Lyss", "Jona", "Obertshausen", "Ohrdruf")]
 [string] $Location,
  
 [Parameter(Mandatory=$true)]
 [bool] $Swyx,
  
 [Parameter(Mandatory=$true)]
 [bool] $PREPROD
  
  
 )

 

And in the Script

if ( $PREPROD )
 {
 $Path = "OU=Users,OU=Accounts,OU=" + $Location + ",OU=" + $c + ",OU=PreProd,DC=domain,DC=local"
 Write-Output "Preprod true"
 }
 else
 {
 $Path = "OU=Users,OU=Accounts,OU=" + $Location + ",OU=" + $c + ",OU=PreProd,DC=domain,DC=local"
 Write-Output "Preprod false"
 }
Highlighted
Regular Visitor

Re: Sharepoint List Item boolean not working in Azure Automation

Hello @v-yuazh-msft,

 

Could you please share a full screenshot of the configuration of  Azure Automation action in your flow?

AzureAutoFlow.png

Could you please share a screenshot of the run history when the flow run failed?

The Flow run is running successfully but, the script failes because the yes/no column from sharepoint is transmitted as string not as boolean. So i receive the following error message in my azure automation runbook:

AzureRunbookFailed.png

Does the 2 booleans column that you mentioned in sharepoint list are the "Yes/No" type? Could you please share more details about the 2 booleans column? 

 

Yes they are yes/no type.

In my runbook i run some commands if one of them is true.

SwyxUser will create a new user in our telephone system if its true

PreProd will create a AD user in a Pre production OU in AD for testing

 

Sharepoint list looks like this:

image.png

 

Highlighted
Regular Visitor

Re: Sharepoint List Item boolean not working in Azure Automation

Hi @v-yuazh-msft,

 

do you have any idea what i can do? I posted all the informations.

 

Thank you in advance!

 

Best regards

 

Michael

Helpful resources

Announcements
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Users online (6,443)