我正在使用power自动化从Json API中提取一些Json数据。Power自动从示例查询生成架构。问题是,它生成的查询不能用于所有查询,因为它将类型设置为"string“,一些空值将出现在某些查询中。是否需要将所有类型从"string“更改为"string”、"null"?这似乎是Power应该自动为类型所做的事情。
这是错误消息的一部分。
"message": "Invalid type. Expected String but got Null.",
这是模式。
{
"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"
}
发布于 2022-10-04 05:46:37
不久,解析json操作将能够处理空值。
这个特性预计将在本月影响通用可用性:https://learn.microsoft.com/en-gb/power-platform-release-plan/2022wave2/power-automate/parse-json-action-now-handles-null-objects
https://stackoverflow.com/questions/73940223
复制相似问题