0

I am not able to get the original value of the parameter that has been matched with the entity. I already have an output context and I can see the entity.original value in the request json, but I am not able to get the value. I have tried the methods this post (How do I get parameter value from arguments?) and this post (DialogFlow - Get original string associated with parameter) mentioned.But none seem to work. They simply return the entity name or undefined. Any help is appreciated.

Here is a part of the Request JSON

"outputContexts": [
      {
        "name": "projects/XXXXXXX/agent/sessions/XXXX/contexts/office",
        "lifespanCount": 1,
        "parameters": {
          "name": [
            "name"
          ],
          "name.original": [
            "scott"
          ]
        }
          },

I want to get the "name.original" value.

Aditya Das
  • 1
  • 1
  • 2
  • Figured it out: let value = conv.contexts.input.${"_input-context's name_"}.parameters[""matched_parameters_name".original"]; Which still seems like a cumbersome way. If there is any other way to find out the value. Do tell. Thank you – – Aditya Das Jul 26 '19 at 00:42
  • There is another hack, where instead of input context you can put this. let value = conv.contexts.input.actions_capability_screen_output.parameters['"matched_parameters_name"'formNames.original']; – Aditya Das Jul 26 '19 at 00:43

1 Answers1

0

What you can do is within dialogflow, add a new parameter that has a value of the name of the parameter you want the original text of, and add .original.

Now when ever you want let's say date.original, you simply request originalDate.

Dialogflow actions and parameter