Hey, i have a powerapp that takes a text input field and passes it through to a flow. The flow takes the text input string from the powerapp and creates an azure automation powershell job. The flow waits while the automation job executes, then receives the runbook output. This is where i am stuck. The format of the runbook output is not json, so i can't use a parse json action and i don't know any other way of parsing the output to use further down the flow.
The runbook itself, is a simple powershell script that performs a get-azureaduser -objectid $upn. The $upn is a runbook parameter, and provided by the user in the powerapp.
This is the output of the content field from the "Get job output" flow action. Its format is a combination of PSObject (maybe) and JSON..
Account : automation@domain.com
Environment : AzureCloud
Tenant : nnnn-nnnn-nnnn-nnnn-nnnn
TenantId : nnnn-nnnn-nnnn-nnnn-nnnn
TenantDomain : domain.onmicrosoft.com
{
"UPN": "user1@domain.com",
"Department": "Technology",
"Title": "Information Technology",
"Country": "Australia",
"ImmutableId": "nnnnnn"
}

Here is the runbook powershell code.
Param
(
[Parameter (Mandatory= $true)]
[string] $UPN = ""
)
import-module azuread
$creds = Get-AutomationPSCredential -Name 'creds'
connect-azuread -credential $creds
$u = get-azureaduser -objectid $UPN
$objOut = [PSCustomObject]@{
UPN = $u.UserPrincipalName
Department = $u.Department
Title = $u.JobTitle
Country = $u.Country
ImmutableId = $u.ImmutableId
}
Write-Output ( $objOut | ConvertTo-Json)
Here is the failure.
InvalidJSON. The 'content' property of actions of type 'ParseJson' must be valid JSON. The provided value '
Account : automation@domain.com
Environment : AzureCloud
Tenant : nnnn-nnnn-nnnn-nnnn-nnnn
TenantId : nnnn-nnnn-nnnn-nnnn-nnnn
TenantDomain : domain.onmicrosoft.com
{
"UPN": "user1@domain.com",
"Department": "Technology",
"Title": "Information Technology",
"Country": "Australia",
"ImmutableId": "nnnnnn"
}
' cannot be parsed: 'Unexpected character encountered while parsing value: A. Path '', line 0, position 0.'.