Arrays 如何更改Watson Assistant中的上下文值
我在更改值时遇到问题,我在对话开始时有这个上下文Arrays 如何更改Watson Assistant中的上下文值,arrays,json,ibm-watson,watson-assistant,Arrays,Json,Ibm Watson,Watson Assistant,我在更改值时遇到问题,我在对话开始时有这个上下文 "context": { "Trips" : { "Germany": { "Info": null, "Dates": null, "Prices": null, "Flights": null, "Layaway": null,
"context": {
"Trips" : {
"Germany": {
"Info": null,
"Dates": null,
"Prices": null,
"Flights": null,
"Layaway": null,
"Requirements": null
}
}
}
当用户请求信息时,如何将信息值更改为True
我尝试使用这样的数组
"context": {
"Trips" : {
"Germany": [
{
"Info": null
},
{
"Dates": null
},
{
"Prices": null
},
{
"Flights": null
},
{
"Layaway": null
},
{
"Requirements": null
}
]
}
}
我使用“然后设置上下文””来更改该值
"context": {
"remove": "\"<? $Trips.Germany.removeValue({\"Info\"==null\") ?>\"",
"experiences": "<? $Trips.Germany.append({Info : True}) ?>"
}
但我得到了一个错误:
计算对话框节点ID时出现SpelEvaluationException[响应\u 1\u 1576705519309]。条件[$Trips.Germany.indexOf(“Info”)==true]的语法有效,但无法计算。检查表达式中的对象是否为null或超出范围。SpEL求值错误:EL1008E:在类型为“JsonArray”的对象上找不到属性或字段“Germany”-可能不是公共的?(日志中还有1个错误)
有没有一种方法可以在不依赖其他值的情况下只识别一个值?最好嵌入代码示例,而不是仅仅链接:)对不起,这是我关于Stackoverflow的第一篇文章
$Trips.Germany.indexOf("Info")==true