Bixby 如何为新用户提供不同的结果视图

Bixby 如何为新用户提供不同的结果视图,bixby,Bixby,如何为新用户提供不同的结果视图消息或布局 在本例中,我希望视图有所不同,这取决于用户是否是UserData概念中所示的新用户,我在操作GetAltBrainsData中计算其值。 我已将存储的功能配置文件提供给UserData result-view { match: AltBrainsData (this) { from-output: GetAltBrainsData (getaltbrainsdata) } message { //here is whe

如何为新用户提供不同的结果视图消息或布局

在本例中,我希望视图有所不同,这取决于用户是否是UserData概念中所示的新用户,我在操作GetAltBrainsData中计算其值。 我已将存储的功能配置文件提供给UserData

result-view {
  match: AltBrainsData (this) 
  { 
  from-output: GetAltBrainsData (getaltbrainsdata)
  }

  message {

    //here is where i want to check if UserData.newuser = true and vary the answer
  //if (userdata.newuser) {template("hello new user")} else ...


    if (size(this) > 1) {
    template ("I found #{(size(this))} AltBrains")
    }
    else-if (size(this) == 1 ) {
    template ("") {speech ("#{value(this.name)}")}
    }
    else {template ("No AltBrains matched the search.")}
     }

  render {

    // if UserData.newuser = true then welcome layout
但是结果视图似乎仍然没有意识到UserData。IDE抱怨它在UserData中是一个非法表达式。newuser

尝试
if(getaltbrainsdata.UserData.newuser)
,或者您在操作模型中命名的任何内容

另一种方法是使用匹配模式访问它,如

result-view {
  match: AltBrainsData (this) 
  { 
  from-output: GetAltBrainsData (getaltbrainsdata) {
      from-input: UserData (userData)
  }
...

一如既往地乐于助人。使用匹配模式,开发人员基本上可以在视图中引用任何“按操作分组在一起”的概念。