Power Automate中使用Json解析时如何允许值为NUll

Parse JSON在Power Automate中是一个比较常用的操作,通常我们用来解析JSON数据时,Schema选择从Json数据示例生成,示例如下图:

Power Automate中使用Json解析时如何允许值为NUll

我们可以看到在Schema中,name是string类型,age是integer类型,正常来说没有问题的,测试的结果也是成功的

Power Automate中使用Json解析时如何允许值为NUll

 

但是在实际运行中,会出现name的值为NULL的情况,这是后flow执行就会报“Invalid type. Expected String but got Null”

Power Automate中使用Json解析时如何允许值为NUll

因此我们必须手动修改Schema,使用anyof来定义可为空的值,示例如下:

Power Automate中使用Json解析时如何允许值为NUll

上一篇:Python基础详解(十五):json.dump()、json.dumps()、json.load()、json.loads()


下一篇:MYSQL