web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / JSON Parse Fail with A...
Power Automate
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.

Categories:
I have the same question (0)
  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    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

  • dennisb88 Profile Picture
    603 on at

    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,865 Most Valuable Professional on at

    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

    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.

  • Verified answer
    abm abm Profile Picture
    32,865 Most Valuable Professional on at

    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

    Hi @abm ,

     

    Thank you! That was the trick!

     

    I'm a happy guy at this moment!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard