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 / Help with Microsoft Fl...
Power Automate
Answered

Help with Microsoft Flow Parse JSON

(0) ShareShare
ReportReport
Posted on by 30

I am feeding a JSON from Azure Automation Runbook to Microsoft Flow

 

I am getting an error:

'Unexpected token encountered when reading value for 'OdataType'. Expected StartObject, Boolean, got String. Path 'schema.properties.InvitedUser.properties.OdataType'.'.

My JSON schema looks like this:

https://gist.github.com/ian-nevda/c3cfc8aa177dcf0e9f6d999bebfce331

My original JSON that I am trying to feed to flow looks like this:

https://gist.github.com/ian-nevda/a691f07f206b9fe8fc0539f56034a2cf

 

As you can see in the original, in most cases the field "OdataType" is null. I tried defining it as "string" in the schema which doesn't appear to work.

 

I am not sure how to re-format my schema to make this work 😞

Any help at all is appreciated.

Categories:
I have the same question (0)
  • Jcook Profile Picture
    7,781 Most Valuable Professional on at

    Hello @IanNev 

     

    Thank you for the JSON sample, I was able to get your Sample JSON to parse correctly.

    What I did was, for all values that could be null, I removed the type. This allows the JSON to parse with any type.

     

    Here is the Schema:

    {
     "type": "object",
     "properties": {
     "Id": {
     "type": "string"
     },
     "InvitedUserDisplayName": {
     "type": "string"
     },
     "InvitedUserEmailAddress": {
     "type": "string"
     },
     "SendInvitationMessage": {
     "type": "boolean"
     },
     "InviteRedeemUrl": {
     "type": "string"
     },
     "InviteRedirectUrl": {
     "type": "string"
     },
     "InvitedUser": {
     "type": "object",
     "properties": {
     "Id": {
     "type": "string"
     },
     "OdataType":{
     }
     }
     },
     "InvitedUserMessageInfo": {
     "type": "object",
     "properties": {
     "CcRecipients": {
     "type": "array",
     "items": {
     "type": "string"
     }
     },
     "CustomizedMessageBody": {
    
     },
     "MessageLanguage": { 
     }
     }
     },
     "InvitedUserType": {
     "type": "string"
     },
     "Status": {
     "type": "string"
     }
     }
    }

     

     

  • IanNev Profile Picture
    30 on at

    Hello,

     

    Thank you very much for your reply.

     

    I've tried using your suggested schema but unfortunately ended up with this error

     

    Unable to process template language expressions in action 'Parse_JSON' inputs at line '1' and column '2221': 'Required property 'content' expects a value but got null. Path ''.'.

     

    I've confirmed that my latest runbook test completed successfully and generated the output JSON properly.

     

    For reference, here is a screenshot of my flow configuration.

     

    Screen Shot 2020-06-10 at 10.20.09 PM.png

     

    Once again, any and all help is extremely appreciated.

     

  • Jcook Profile Picture
    7,781 Most Valuable Professional on at

    Hi @IanNev 


    I am a bit confused. In the screenshot you posted, you are using a a different schema than I provided.

  • IanNev Profile Picture
    30 on at

    Sorry for the confusion. The screenshot is outdated but the error I am getting comes out as result of using your schema.

     

    Thank you,

     

    Ian

  • Jcook Profile Picture
    7,781 Most Valuable Professional on at

    Hi @IanNev 

     

    Okay, thanks for clarifying.

     

    The error:

    Unable to process template language expressions in action 'Parse_JSON' inputs at line '1' and column '2221': 'Required property 'content' expects a value but got null. Path ''.'.

     

    Means that the JSON that is being passed into the Parse JSON is empty/null

     

    Would you be able to try and run again.

     

    Post a updated screenshot of the Flows Runbook action so we know what is being passed in to the Parse JSON

     

     

  • IanNev Profile Picture
    30 on at

    Thank you. 

     

    Here is the results of my latest Flow run

     

    1.PNG

     

    Here is the result of the latest runbook triggered by this Flow

     

    2.png

     

     

  • Jcook Profile Picture
    7,781 Most Valuable Professional on at

    @IanNev 

     

    Would you be able to add a Compose action in between the Run book and Parse JSON.

     

    Inside the Compose action put the Dynamic Content 'content' inside.

     

    Again, I think it is weird that the Error is saying the JSON is empty.

    If you want to check if Schema is the issue. You can put the schema as:

     

    {}

     

  • IanNev Profile Picture
    30 on at

    Tried adding a compose action as per your recommendation. Both Input and Output fields return empty files. So I guess my runbook object never gets through to my Flow.

     

    Perhaps the issue is with my Powershell code then?

     

    My script is quite simple, here it is:

     

    #send AzureAD invitation
    
    $newuser = New-AzureADMSInvitation -InvitedUserEmailAddress $guestemail -InvitedUserDisplayName $displayname -InviteRedirectURL https://myapps.microsoft.com -SendInvitationMessage $true
    
    #extract userid for further flow config
    
    Write-Output $newuser | ConvertTo-Json
     
  • Jcook Profile Picture
    7,781 Most Valuable Professional on at

    @IanNev 

    How are you triggering the flow? Are you triggering manually? Or are you using the test button at the top right corner?

  • IanNev Profile Picture
    30 on at

    I am triggering it manually. Not a test run. I enter all the parameters I've defined and they get passed down to the runbook. I can confirm that my guest user invitation does get sent and that part of the flow is working. 

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