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 / The schema definition ...
Power Automate
Unanswered

The schema definition for action with status code '200' is not valid. The schema definitions for actions with same status code must match.

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi all,

I'm trying to make an http call, parse the json, and respond to Powerapps.

I've tried multiple times to get the json just right for the respond to Powerapps but no matter what I try i'm getting "The schema definition for action with status code '200' is not valid. The schema definitions for actions with same status code must match."  

What's the best way to get this json just right so it matches?  I've tried grabbing it from the output of the parse json, from Postman, etc and have failed each time.  

Any tips?

Thanks!

Categories:
I have the same question (0)
  • Ed Gonzales Profile Picture
    4,531 Most Valuable Professional on at

    @russrimm 

    Hey there.  So that I'm not presuming anything, can you show the output of the HTTP call and then what the schema looks like in your Parse JSON step?

     

    Did you use sample data to let Power Automate build the schema? or did you build it yourself?


    Thanks!

    -Ed

     

    If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

  • russrimm Profile Picture
    Microsoft Employee on at
    Hi @edgonzales, thanks for the reply.  I used Power Automate to build it.  I really only need the amount, fromcompany, treatment, and surgtype fields to be returned to the PowerApp.
     
    Output of HTTP Call:
    {
        "count"13,
        "offset"0,
        "limit"50,
        "hasMore"false,
        "requestedFields""amount,fromcompany,treatment,surgtype",
        "items": [
          {
            "itemId": {
              "native""04b5cf0c-8970-49a6-997a-9025f2d1f86e",
              "partner"null
            },
            "dataObject": {
              "treatment""Injections"
            },
            "links": {}
          },
          {
            "itemId": {
              "native""b418bbb3-20e1-4fa9-9495-df00802a74e3",
              "partner"null
            },
            "dataObject": {
              "treatment""MRI"
            },
            "links": {}
          },
          {
            "itemId": {
              "native""899950fb-2a1f-424d-bc55-96d66b8522e6",
              "partner"null
            },
            "dataObject": {
              "treatment""MRI",
              "surgtype""Spine"
            },
            "links": {}
          },
          {
            "itemId": {
              "native""c2b35ab4-fe36-4421-b6b8-d3ff594cc084",
              "partner"null
            },
            "dataObject": {},
            "links": {}
          },
          {
            "itemId": {
              "native""0d96e75f-8dce-4751-8bff-daca062e6bfc",
              "partner"null
            },
            "dataObject": {},
            "links": {}
          },
          {
            "itemId": {
              "native""fcb6862d-c973-4025-8ddc-fbd6edf3f114",
              "partner"null
            },
            "dataObject": {
              "amount"500,
              "treatment""Surgical Candidate",
              "surgtype""Spine"
            },
            "links": {}
          },
          {
            "itemId": {
              "native""b9724400-e916-464b-96d5-6e681aa73ed0",
              "partner"null
            },
            "dataObject": {
              "amount"10000,
              "treatment""Pain Management"
            },
            "links": {}
          },
          {
            "itemId": {
              "native""bd434ee6-55d4-4fe4-acaa-a6331a1c7760",
              "partner"null
            },
            "dataObject": {
              "amount"50000,
              "treatment""Pain Management"
            },
            "links": {}
          },
          {
            "itemId": {
              "native""22a16f5b-9461-4bf7-9bdd-44b9722be700",
              "partner"null
            },
            "dataObject": {
              "amount"5000,
              "treatment""Chiropractic Care"
            },
            "links": {}
          },
          {
            "itemId": {
              "native""07cb0585-d837-48c6-a47f-4cf1b65d946a",
              "partner"null
            },
            "dataObject": {
              "amount"2500,
              "treatment""MRI"
            },
            "links": {}
          },
          {
            "itemId": {
              "native""34e589ae-185f-45cd-affd-58854846317b",
              "partner"null
            },
            "dataObject": {
              "amount"3589,
              "treatment""Pharmacy"
            },
            "links": {}
          },
          {
            "itemId": {
              "native""095d1219-4367-474a-991a-cc915849439b",
              "partner"null
            },
            "dataObject": {
              "amount"7800,
              "treatment""Pain Management"
            },
            "links": {}
          },
          {
            "itemId": {
              "native""2bd95729-8f81-46a1-b76e-db27eeee0709",
              "partner"null
            },
            "dataObject": {
              "amount"12000,
              "treatment""Chiropractic Care"
            },
            "links": {}
          }
        ],
        "links": {
          "self""/projects/2071983/collections/meds?offset=0&limit=50&requestedFields=amount,fromcompany,treatment,surgtype",
          "prev"null,
          "next"null
        }
      }
     
    For the Parse Json, I'm using the Body of the HTTP call output with this schema:
    {
        "type""object",
        "properties": {
            "items": {
                "type""array",
                "items": {
                    "type""object",
                    "properties": {
                        "itemId": {
                            "type""object",
                            "properties": {
                                "native": {
                                    "type""string"
                                },
                                "partner": {}
                            }
                        },
                        "dataObject": {
                            "type""object",
                            "properties": {
                                "treatment": {
                                    "type""string"
                                }
                            }
                        },
                        "links": {
                            "type""object",
                            "properties": {}
                        }
                    },
                    "required": []
                }
            },
            "count": {
                "type""integer"
            },
            "offset": {
                "type""integer"
            },
            "limit": {
                "type""integer"
            },
            "hasMore": {
                "type""boolean"
            },
            "requestedFields": {
                "type""string"
            },
            "links": {
                "type""object",
                "properties": {
                    "self": {
                        "type""string"
                    },
                    "prev": {},
                    "next": {}
                }
            }
        }
    }
  • Ed Gonzales Profile Picture
    4,531 Most Valuable Professional on at

    @russrimm 

    Try swapping out your schema with this (Save your old one to Notepad or something, just in case):

     

    {
    "type": "object",
    "properties": {
    "count": {
    "type": "integer"
    },
    "offset": {
    "type": "integer"
    },
    "limit": {
    "type": "integer"
    },
    "hasMore": {
    "type": "boolean"
    },
    "requestedFields": {
    "type": "string"
    },
    "items": {
    "type": "array",
    "items": {
    "type": "object",
    "properties": {
    "itemId": {
    "type": "object",
    "properties": {
    "native": {
    "type": "string"
    },
    "partner": {}
    }
    },
    "dataObject": {
    "type": "object",
    "properties": {
    "treatment": {
    "type": "string"
    }
    }
    },
    "links": {
    "type": "object",
    "properties": {}
    }
    },
    "required": [
    "itemId",
    "dataObject",
    "links"
    ]
    }
    },
    "links": {
    "type": "object",
    "properties": {
    "self": {
    "type": "string"
    },
    "prev": {},
    "next": {}
    }
    }
    }
    }

     

    Once you've got the parse working, you'll have to do a bit of wizardry because most of what you want is inside the dataobject portion of the item record.  Just some drilling down, I think.  But, the fromcompany isn't anywhere, are you certain that is part of this dataset?

     

    Keep at it, you'll get it soon!

    -Ed

     

     

    If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

  • russrimm Profile Picture
    Microsoft Employee on at

    Thanks @edgonzales, unfortunately it's the same error The schema definition for action with status code '200' is not valid. The schema definitions for actions with same status code must match.

  • russrimm Profile Picture
    Microsoft Employee on at

    @edgonzales I assume that json was to be put in the http response not in the parse json step?  Any other ideas why it might be failing?  This respond to Powerapps step seems to be tricky to get just right.

  • Ed Gonzales Profile Picture
    4,531 Most Valuable Professional on at

    @russrimm 

    That was my next question, I should have clarified earlier sorry.  You are getting the error on the HTTP step?  I actually meant the sample JSON fo the parsing step, sorry.  Maybe it would be good to understand the data a bit more.  To where are you making the HTTP call?  what does that look like?  Have you tried the call without any schema?

     

    When testing stuff like this, I'll usually set up a small flow with a manual trigger and the HTTP step after.  This lets me troubleshoot that connection without bothering the PowerApp and the rest of the other flow.

     

    Keep us posted.

    -Ed

     

    If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

  • russrimm Profile Picture
    Microsoft Employee on at

    Hi @edgonzales,

    The schema definition error is on the http response step.  Interestingly, this is one case within a switch, and my first case is working fine but the Get request is different, but to the same API.  Through trial and error, I found out if I take the http response json from the working case and paste it into the erroring one, it stops erroring out, but of course its not the same request so I don't get the values I need returned.  I'm making the api call to api.filevine.io.

  • Suggested answer
    EN-21101222-0 Profile Picture
    2 on at
    You are seeing this error because the success and error schemas are different.
    You can either compare the schemas and update properties not matching to be optional or use Scope Action to implement a Try Catch pattern.
    Try Catch pattern example:
    Steps:
    After the action that fails add a Scope Action and name it Try.
    Implement your happy path inside that scope with success response to app or flow.
    Add a new scope afterwords and name it Catch.
    Click the 3 dots menu in this Scope and select "Configure run after".
    Select "has failed" checkbox, make sure other options are not selected.
    Now inside this scope Create the path for failure cases and end with the Response you want when it fails.
    In this last scope you should be able to switch between different Error status as long as their schema definitions are identical.

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 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard