cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FlyingM
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
v-yuazh-msft
Community Support
Community Support

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

FlyingM
Regular Visitor

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"
 }

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

 

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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,432)