Hi
I have a flow that triggers a PowerShell RunBook in an Automation account. I have a Get job Output action next which gets something like:
Account : 1234566789
Environment : AzureCloud
Tenant : 1234566789
TenantId : 1234566789
TenantDomain : ourtenent.onmicrosoft.com
Account : 12344567
Environment : AzureCloud
Tenant : 12345678
TenantId : 12346780
TenantDomain : ourtenent.onmicrosoft.com
{
"Connection": "Successful"
"CreateTeam": "Successful"
"TeamName": "My Test"
"TeamOwner": "john.doe@ourdomain.co.uk"
"TeamScope": "External",
"UpdateGroupSettings": "Successful"
"AddToExternalAdminUnit": "Failed to add to ExternalO365Groups Admin Unit"
}
Id like to extract the JSON formatted bit (between the curly braces) to be able to troubleshoot the output. How do i do this?
cheers 🙂
Perfect - thanks 🙂
Hello @StevieC ,
if you can add a comma after each line in the JSON formatted bit (change it in the PowerShell), you can access the elements as an array:
And if you need to extract the JSON part from the full output, I'd do it with the split(...) expression by the '{' character, take only the second part of the split, add back the '{' and convert it to JSON. And then access it as an array.
json(concat('{',split(outputs('Compose_11'),'{')[1]))
But both solutions require that you can add a comma after each line in the JSON-like part.
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2