Monday, April 1, 2024

Power Automate - "The input body for trigger 'manual' of type 'Request' did not match its schema definition. Error details: 'Required properties are missing from object: location.'"

 I've noticed on occasion that when calling a child workflow in power automate, I'd get the following error message:

The input body for trigger 'manual' of type 'Request' did not match its schema definition. Error details: 'Required properties are missing from object: location.'.

From what I can tell, it seems to happen if I save the child workflow in the "New Designer" mode, which adds location as a required field:

{
  "type""Request",
  "kind""Button",
  "inputs": {
    "schema": {
      "type""object",
      "properties": {
        "number": {
          "title""ID Start",
          "type""number",
          "x-ms-dynamically-added"true,
          "description""Please enter the Employee ID to start with",
          "x-ms-content-hint""NUMBER"
        },
        "number_1": {
          "title""ID End",
          "type""number",
          "x-ms-dynamically-added"true,
          "description""Please enter the Employee ID to end with",
          "x-ms-content-hint""NUMBER"
        },
        "location": {
          "type""object",
          "properties": {
            "fullAddress": {
              "title""Full address",
              "type""string",
              "x-ms-dynamically-added"false
            },
            "address": {
              "type""object",
              "properties": {
                "countryOrRegion": {
                  "title""Country/Region",
                  "type""string",
                  "x-ms-dynamically-added"false
                },
                "city": {
                  "title""City",
                  "type""string",
                  "x-ms-dynamically-added"false
                },
                "state": {
                  "title""State",
                  "type""string",
                  "x-ms-dynamically-added"false
                },
                "street": {
                  "title""Street",
                  "type""string",
                  "x-ms-dynamically-added"false
                },
                "postalCode": {
                  "title""Postal code",
                  "type""string",
                  "x-ms-dynamically-added"false
                }
              },
              "required": [
                "countryOrRegion",
                "city",
                "state",
                "street",
                "postalCode"
              ]
            },
            "coordinates": {
              "type""object",
              "properties": {
                "latitude": {
                  "title""Latitude",
                  "type""number",
                  "x-ms-dynamically-added"false
                },
                "longitude": {
                  "title""Longitude",
                  "type""number",
                  "x-ms-dynamically-added"false
                }
              },
              "required": [
                "latitude",
                "longitude"
              ]
            }
          }
        },
        "key-button-date": {
          "title""Date",
          "type""string",
          "x-ms-dynamically-added"false
        }
      },
      "required": [
        "number",
        "number_1",
        "location",
        "key-button-date"
      ]
    }
  },
  "metadata": {
    "operationMetadataId""2447e36d-f686-4dfd-aefa-c73d0383839f4"
  }
}

The only way I've found to fix it is to delete the manual trigger of the child flow, in the old designer view, and recreate the manual trigger from scratch.  And then update anywhere your original parameters were used.