0

I am using power automate to pull some Json data from the Egnyte API. Power Automate generates a schema from example queries. The problem is the query it generates will not work on all queries because it will set type to "string" and some null values will be in some queries. Do I need to change all type from "string" to ["string","null"]? It seems like this is something Power automate should do automatically for types.

This is part of the error Message.

"message": "Invalid type. Expected String but got Null.", 

Here is the schema.

{
"properties": {
    "itemsPerPage": {
        "type": "integer"
    },
    "resources": {
        "items": {
            "properties": {
                "active": {
                    "type": "boolean"
                },
                "authType": {
                    "type": "string"
                },
                "createdDate": {
                    "type": "string"
                },
                "deleteOnExpiry": {
                },
                "email": {
                    "type": "string"
                },
                "emailChangePending": {
                    "type": "boolean"
                },
                "expiryDate": {
                },
                "externalId": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "idpUserId": {
                    "type": "string"
                },
                "isServiceAccount": {
                    "type": "boolean"
                },
                "lastActiveDate": {
                    "type": "string"
                },
                "lastModificationDate": {
                    "type": "string"
                },
                "locked": {
                    "type": "boolean"
                },
                "name": {
                    "properties": {
                        "familyName": {
                            "type": "string"
                        },
                        "formatted": {
                            "type": "string"
                        },
                        "givenName": {
                            "type": "string"
                        }
                    },
                    "type": "object"
                },
                "role": {
                    "type": "string"
                },
                "userName": {
                    "type": "string"
                },
                "userPrincipalName": {
                },
                "userType": {
                    "type": "string"
                }
            },
            "required": [
                "id",
                "userName",
                "externalId",
                "email",
                "name",
                "active",
                "locked",
                "emailChangePending",
                "authType",
                "userType",
                "role",
                "idpUserId",
                "userPrincipalName",
                "expiryDate",
                "deleteOnExpiry",
                "createdDate",
                "lastModificationDate",
                "lastActiveDate",
                "isServiceAccount"
            ],
            "type": "object"
        },
        "type": "array"
    },
    "startIndex": {
        "type": "integer"
    },
    "totalResults": {
        "type": "integer"
    }
},
"type": "object"

}

Michael Hearn
  • 557
  • 6
  • 18
  • Got an example JSON we can play with? Also, show us your flow so we can get a hold of your approach. – Skin Oct 04 '22 at 01:48
  • I have API keys in the flow so I can't share it with you but I can share the Schema. – Michael Hearn Oct 04 '22 at 13:22
  • Just obfuscate the keys. I don’t particularly want to have to fashion up an example off the schema, much quicker if you just change the values you don’t want us to see. – Skin Oct 04 '22 at 20:33

2 Answers2

0

Soon the parse json action should be able to handle null values.

This feature is expected to hit General Availability this month: https://learn.microsoft.com/en-gb/power-platform-release-plan/2022wave2/power-automate/parse-json-action-now-handles-null-objects

Expiscornovus
  • 1,222
  • 1
  • 3
  • 7
0

In my case changing all the instance from "type" : "string" to "type" : ["string", "null"] did solve the problem. It allowed for the Power Automate JSON processing to work with no null value errors.

Michael Hearn
  • 557
  • 6
  • 18