Search code examples
dialogflow-esactions-on-google

Change SignIn default text


I need to change the default text spoken to the user when prompted to SignIn. There is no easy configuration in the flow and I have found in Calling the Helper that no parameter is passed to the SignIn constructor. But, in the Implementation guide there is a parameter: 'To get your account details', which does not appear in the Dialogflow tab.

In the Conversation playground the parameter exists as "optContext" but that does not work either. I am not using the libraries but I provide a fulfillment webhook for which I use only the JSON definitions.

Any advice on the subject? Should I forget about this and use a canvas? Canvas would work for this (I never used it)?

Thank you in advance

I acknowledge that this question is similar to others but their answers are rather old and sdk oriented.


Solution

  • If you're using Dialogflow, and your fulfillment is sending back JSON without using one of the typical libraries, you need to make sure this is included in payload.google section of the response. Specifically, this will be a systemIntent object that contains the specific values relevant to Sign In.

    It might look something like this, where the only part you change is the part labeled "YOUR TEXT GOES HERE". All the other values should be exactly as shown.

    {
      "payload": {
        "google": {
          "expectUserResponse": true,
          "richResponse": {
            "items": [
              {
                "simpleResponse": {
                  "textToSpeech": "PLACEHOLDER"
                }
              }
            ]
          },
          "systemIntent": {
            "intent": "actions.intent.SIGN_IN",
            "data": {
              "@type": "type.googleapis.com/google.actions.v2.SignInValueSpec",
              "optContext": "YOUR TEXT GOES HERE"
            }
          }
        }
      }
    }