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

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / parse jason validation...
Power Automate
Unanswered

parse jason validation error

(0) ShareShare
ReportReport
Posted on by 21

Hello

when I run my flow it returns me a parse jason validation error, the schema valdation has failed. I don't know how to fix the error.

This is the error

[
  {
    "message""Invalid type. Expected Object but got Array.",
    "lineNumber"0,
    "linePosition"0,
    "path""",
    "schemaId""#",
    "errorType""type",
    "childErrors": []
  }
]
 
an this is the jason scheme
{
  "type""object",
  "properties": {
    "content": {
      "type""string"
    },
    "schema": {
      "type""object",
      "properties": {
        "type": {
          "type""string"
        },
        "properties": {
          "type""object",
          "properties": {
            "type": {
              "type""object",
              "properties": {
                "type": {
                  "type""string"
                }
              }
            },
            "properties": {
              "type""object",
              "properties": {
                "type": {
                  "type""string"
                },
                "properties": {
                  "type""object",
                  "properties": {
                    "name": {
                      "type""object",
                      "properties": {
                        "type": {
                          "type""string"
                        },
                        "properties": {
                          "type""object",
                          "properties": {
                            "type": {
                              "type""object",
                              "properties": {
                                "type": {
                                  "type""string"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "link": {
                      "type""object",
                      "properties": {
                        "type": {
                          "type""string"
                        },
                        "properties": {
                          "type""object",
                          "properties": {
                            "type": {
                              "type""object",
                              "properties": {
                                "type": {
                                  "type""string"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "id": {
                      "type""object",
                      "properties": {
                        "type": {
                          "type""string"
                        },
                        "properties": {
                          "type""object",
                          "properties": {
                            "type": {
                              "type""object",
                              "properties": {
                                "type": {
                                  "type""string"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "type": {
                      "type""object",
                      "properties": {
                        "type": {
                          "type""string"
                        }
                      }
                    },
                    "size": {
                      "type""object",
                      "properties": {
                        "type": {
                          "type""string"
                        },
                        "properties": {
                          "type""object",
                          "properties": {
                            "type": {
                              "type""object",
                              "properties": {
                                "type": {
                                  "type""string"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "referenceId": {
                      "type""object",
                      "properties": {
                        "type": {
                          "type""string"
                        },
                        "properties": {
                          "type""object",
                          "properties": {
                            "type": {
                              "type""object",
                              "properties": {
                                "type": {
                                  "type""string"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "driveId": {
                      "type""object",
                      "properties": {
                        "type": {
                          "type""string"
                        },
                        "properties": {
                          "type""object",
                          "properties": {
                            "type": {
                              "type""object",
                              "properties": {
                                "type": {
                                  "type""string"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "status": {
                      "type""object",
                      "properties": {
                        "type": {
                          "type""string"
                        },
                        "properties": {
                          "type""object",
                          "properties": {
                            "type": {
                              "type""object",
                              "properties": {
                                "type": {
                                  "type""string"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "uploadSessionUrl": {
                      "type""object",
                      "properties": {
                        "type": {
                          "type""string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
 
Anyone may help me?
Tx
Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,678 Most Valuable Professional on at
    Re: parse jason validation error

    How did you create the schema?  Did you use a sample output from a run?  The problem is that your schema is designed around an object value and instead it is getting an array of objects.  Use an empty schema in the parse JSON for the next run. Like the one below.

    {}

    Then take the output from the run and use that as a sample to Generate a new schema.

     

  • corrado1170 Profile Picture
    21 on at
    Re: parse jason validation error

    Thank you!

    I've managed the flow to work now. But now I have another problem, I have used the outlook send email v2 and I raceive the email with the current attachments. The problem is that I cannot open any attachment as they seem to be corrupeted.

    How can I solve this?

    Thank you

  • corrado1170 Profile Picture
    21 on at
    Re: parse jason validation error

    I have also tried using a gmail account with the same bad result. Is there a way to paste the link of the attachment fo download in the body of the email instead of attach the file?

  • Pstork1 Profile Picture
    68,678 Most Valuable Professional on at
    Re: parse jason validation error

    This is usually an issue with the JSON being used to create the attachment array.  What does your JSON for adding the attachments look like and how are you retrieving the content.

  • corrado1170 Profile Picture
    21 on at
    Re: parse jason validation error

    Here is my flow details:

    Screen Shot 2021-11-07 at 17.33.25.pngScreen Shot 2021-11-07 at 17.33.52.png

    This is the JASON schema that I've got from the Compose

    {
        "type""array",
        "items": {
            "type""object",
            "properties": {
                "name": {
                    "type""string"
                },
                "link": {
                    "type""string"
                },
                "id": {
                    "type""string"
                },
                "type": {},
                "size": {
                    "type""integer"
                },
                "referenceId": {
                    "type""string"
                },
                "driveId": {
                    "type""string"
                },
                "status": {
                    "type""integer"
                },
                "uploadSessionUrl": {}
            },
            "required": [
                "name",
                "link",
                "id",
                "type",
                "size",
                "referenceId",
                "driveId",
                "status",
                "uploadSessionUrl"
            ]
        }
    }

     

    Screen Shot 2021-11-07 at 17.34.21.pngScreen Shot 2021-11-07 at 17.33.57.png

     

    After these I've the email send with outlook

    Tx

    Corrado

  • Pstork1 Profile Picture
    68,678 Most Valuable Professional on at
    Re: parse jason validation error

    I suspect its the file identifier you are using.  The file identifier is normally encoded to avoid characters like '\'.  Another common problem is if the Name you are using doesn't have an extension.  I would look at a previous run and check those two things.

  • corrado1170 Profile Picture
    21 on at
    Re: parse jason validation error

    How could I replace the file identifier path with an encoded one?

  • corrado1170 Profile Picture
    21 on at
    Re: parse jason validation error

    tx for the help, I'm not expert of power automate and I've googled around a bit...

  • Verified answer
    corrado1170 Profile Picture
    21 on at
    Re: parse jason validation error

    I found the solution!!!! I've  modified the flow accordingly

    Screen Shot 2021-11-07 at 22.31.06.png

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

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard