Search code examples
jsonibm-cloudibm-watsonwatson-conversation

How I can get the vaule @sys-time in IBM Watson Assistant (Conversation)?


How I can get the value of time? This is my code but I can't see the time

{
  "context": {
    "time": "@sys-time"
  },
  "output": {
    "text": {
      "values": [
        "Is $time"
      ]
    }
  }
}

Solution

  • You need to use the evaluation syntax:

    {
      "context": {
        "time": "<? @sys-time ?>"
      },
      "output": {
        "text": {
          "values": [
            "Is $time"
          ]
        }
      }
    }
    

    You need to also make sure, that in the dialog something with time is mentioned. sys-time does not have the system time, but user input related to time.

    I have several examples collected in this GitHub repository.