You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Power Automate解析JSON标签差异报错的Schema配置方法

故障根因

Parse JSON控件报错核心是自动生成的Schema存在两个配置缺陷:

  1. 将仅在固定选项题型返回的choice_id设置为了所有答案对象的必填字段,开放评论类答案返回的是other_id,无choice_id字段时直接触发必填校验失败,也就是你看到的Required properties are missing from object: choice_id报错
  2. Schema仅覆盖了初始样本里的字段,既没有定义row_id、choice_metadata、text、tag_data等其他题型返回的字段,也没有开启额外字段放行规则,遇到未定义字段就会拦截报错。
可直接使用的修改后Schema

把Parse JSON控件里原来的Schema全量替换成下面的内容即可:

{
  "type": "array",
  "items": {
    "type": "object",
    "additionalProperties": true,
    "properties": {
      "id": {
        "type": "string"
      },
      "answers": {
        "type": "array",
        "items": {
          "type": "object",
          "additionalProperties": true,
          "properties": {
            "choice_id": {
              "type": "string"
            },
            "other_id": {
              "type": "string"
            },
            "row_id": {
              "type": "string"
            },
            "simple_text": {
              "type": "string"
            },
            "text": {
              "type": "string"
            },
            "choice_metadata": {
              "type": "object",
              "additionalProperties": true,
              "properties": {
                "weight": {
                  "type": "string"
                }
              }
            },
            "tag_data": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "hexcolor": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  },
                  "tag_type": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "required": [
            "simple_text"
          ]
        }
      },
      "family": {
        "type": "string"
      },
      "subtype": {
        "type": "string"
      },
      "heading": {
        "type": "string"
      }
    },
    "required": [
      "id",
      "answers",
      "family",
      "subtype",
      "heading"
    ]
  }
}
关键修改说明
  • 调整必填规则:仅保留确认所有场景下一定会返回的字段作为必填项,把choice_id从answers对象的必填列表中移除,choice_id、other_id、row_id等不同题型专属字段全部设为可选,存在就解析、不存在也不触发校验
  • 补全已知字段定义:把排查到的所有SurveyMonkey可能返回的字段全部按实际数据类型补入properties列表,覆盖矩阵题、开放评论题、带情感标签题等多种题型的返回结构
  • 全局开启额外字段放行:在每一层对象节点都添加"additionalProperties": true配置,后续就算SurveyMonkey接口返回未提前定义的新字段,流程也不会因为字段未在Schema中声明而报错,兼容性更强。

替换Schema后不需要调整流程里后续的字段引用,原来已经配置好的choice_id、simple_text等字段取值逻辑可以正常运行,新增的可选字段也会自动出现在动态内容列表里供后续步骤调用。

内容的提问来源于stack exchange,提问作者Jayson Larner

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.29 16:01:06