Bot Framework .NET中的变量过滤器数组
array2 bot当前。
想通过array1项目过滤
"changeType": "push",
"itemsProperty": "user.array2",
"value": "=where(json(user.apiResponse.content).value,x,x.myKey=='magazine')"
对于array1中的每个项目,我 基于Array1中的当前项目,这是不起作用的:
"changeType": "push",
"itemsProperty": "user.array2",
"value":"=where(json(user.apiResponse.content).value,x,x.myKey==concat('\'',json(dialog.forEachThing.value).name,'\''))
我尝试设置一个属性,用户。
"property": "user.myFilter",
"value": "=concat('\\'',json(dialog.forEachThing.value).name,'\\'')"
虽然此user.myfilter正确评估“杂志”,但编辑数组属性/推送没有任何值。
我真的欢迎对我出错的任何想法。我在用户中尝试了一些诸如'''之类的事情。
For each item in array1, I want to filter array2 by the array1 item the bot is currently in.
Within an Edit an array property, if I filter array2 hard-coded like so it creates a nice array:
"changeType": "push",
"itemsProperty": "user.array2",
"value": "=where(json(user.apiResponse.content).value,x,x.myKey=='magazine')"
However if I use a dynamic key based on the current item in array1, this doesn't work:
"changeType": "push",
"itemsProperty": "user.array2",
"value":"=where(json(user.apiResponse.content).value,x,x.myKey==concat('\'',json(dialog.forEachThing.value).name,'\''))
I've tried setting a property, user.myFilter and passing that, as below.
"property": "user.myFilter",
"value": "=concat('\\'',json(dialog.forEachThing.value).name,'\\'')"
And while this user.myFilter evaluates correctly to 'magazine', the Edit an array property/push doesn't get any values.
I'd really welcome any thoughts on where I'm going wrong. I've tried a few things like '''' in user.myFilter but these evaluate as null.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,在此处为关注者更新答案。
原来我错了。无论如何,在.net中,解决方案是简单地不将变量包装在单个引号中。感谢Dana V在Github的头脑中抬起头来。
但是,似乎在JavaScript中可能不起作用。
Ok, updated answer here for those who follow.
Turns out I was wrong. In .Net anyway, the solution is to simply not wrap the variable in single quotes. Thanks to Dana V in github for the heads up.
It seems that may not work in Javascript however.