Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

JSON Parse Fail with Azure Automation output

(0) ShareShare
ReportReport
Posted on by 603

Hi All,

 

I've an Azure Automation script that's will be executed from my flow. With the script I create new Microsoft Teams.

As last point in my script I convert the Groupt-ID to JSON. (write-output $newteam | select GroupID | convertto-Json)

 

Because the Azure Automation runbook script has two outputs. (See image).

Output script.png

 

The first output is a default output, about my account and tenant information. I don't know how to skip this info as output. The second output is the expected output (the GroupId).

 

My Flow is failing because I receive both outputs.

Flow Output.png

This is failing my JSON Parse part in my flow. See second picture.

 

Did any one know what I need to do to skip the account/tenant output and only use the GroupID output?

Thanks in advance.

  • dennisb88 Profile Picture
    603 on at
    Re: JSON Parse Fail with Azure Automation output

    Hi @abm ,

     

    Thank you! That was the trick!

     

    I'm a happy guy at this moment!

  • Verified answer
    abm abm Profile Picture
    32,506 Most Valuable Professional on at
    Re: JSON Parse Fail with Azure Automation output

    Hi @dennisb88 

     

    It's a bit tricky because the output is not a JSON format. So try the below expression.

     

    trim(replace(replace(replace(last(split(outputs('Compose_3'), 'GroupdId')), ':', ''), '}', ''), '"', ''))
     
    Note: Above outputs('Compose_3') is where I input the test data.
     
    image.png
     
     
    Thanks
  • dennisb88 Profile Picture
    603 on at
    Re: JSON Parse Fail with Azure Automation output

    Hi @abm ,

     

    That's correct.

    Reactie.png

    I know that the first part is not JSON. But that's the default output that I get as result after I run the Azure Automation Runbook. The runbook gives two output "objects" where only the second one is the right one:

    Script.png

    I didn't know how I can skip that part of the output and get only the JSON output from Azure Automation.

     

    Regards.

  • abm abm Profile Picture
    32,506 Most Valuable Professional on at
    Re: JSON Parse Fail with Azure Automation output

    Hi @dennisb88 

     

    Because you mentioned the first & second output results I thought you must be getting two different set of JSON results one after the other. Looks like from the screen shot the output is below format:

     

    Account : "ddd"
    Environment : "ddd"
    Tenant : "T"
    TenantId : "TId"
    TenantDomain :
    {
    "GroupdId": "123"
    }

     

    This is not a JSON record format anymore. Is that correct?

     

    Thanks

  • dennisb88 Profile Picture
    603 on at
    Re: JSON Parse Fail with Azure Automation output

    Hi @abm ,

     

    Thank you for your reply.

     

    I didn't realy understand what you mean with "Before it hits the JSON Parser could you check the JSON data string value contains using an IF condition to make sure it's the right data structure you are passing to next step.(Sorry I'm not have JSON skills)

     

    But I think the complete issue is that my Automation Runbook send more output back to my flow than required.

    Maybe are the follow printscreens helping to understand the issue:

    Task output.png

     

    I need only the groupId from the runbook output. But I get also the Run details from the runbook.

    This is since two months. Before half november, it was working fine without the information about the Environment.

     

    The setting "failed" doesn't help.

  • abm abm Profile Picture
    32,506 Most Valuable Professional on at
    Re: JSON Parse Fail with Azure Automation output

    Hi @dennisb88 

     

    Before it hits the JSON Parser could you check the JSON data string value contains using an IF condition to make sure it's the right data structure you are passing to next step. Another way you could do is use flow exception handler under JSON Parser > Configure run after 

     

    image.png 

     

     

     

    Thanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1