I have a PowerShell runbook in Azure and I'm calling it from PowerAutomate. I would like to return a json object for further processing. I tried 3 versions:
$credential = Get-AutomationPSCredential -Name 'messages'
$connection = connect-microsoftteams -credential $credential
$q = Get-CsCallQueue | convertto-json
write-output $q
or
$q = Get-CsCallQueue
return $q
or this:
$q = Get-CsCallQueue | convertto-json
return $q
In all 3 cases the response body is string like:
"body": "{\r\n "DisplayDistributionLists": "532bc784-f6c4-499c-aaad-47478aa2d890",\r\n "DisplayUsers": {\r\n },\r\n "DisplayAgents": "46986d86-6128-441b-a042-8caceecaa324...
When I look at the job, I can see that it is returning the Json array. What can I do to make Flow recognise that a json object is returned, not a string?