Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Assign value to a parameter from custom payload onClick action on Dialogflow CX

Hi! Im kinda new with Dialogflow CX and i'm trying to develop a chatbot with custom payload as Agent reponses when a parameter is empty.

At this moment this chat is integrated with google talk.

I have a parameter called "p_segmento" in a page that uses a created entity as entity type with the required box checked.

chrismp_0-1714784947714.png

I added an Agent reponses with custom payload to display a button with the correct value.

chrismp_2-1714785909538.png

Here is the full json code:

 

 

{
  "cardsV2": [
    {
      "cardId": "seleccionsegmento",
      "card": {
        "sections": [
          {
            "widgets": [
              {
                "buttonList": {
                  "buttons": [
                    {
                      "text": "Cemento",
                      "onClick": {
                        "action": {
                          "function": "$session.params.p_segmento",
                          "parameters": [
                            {
                              "value": "Cemento",
                              "key": "$session.params.p_segmento"
                            }
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            ]
          }
        ]
      }
    }
  ],
  "text": "Indique qué segmento desea consultar, puede seleccionar una opción de la lista o ingrese un texto:"
}

 

 

I need to store the selected value from the custom payload into the parameter "p_segmento"  when the user clicks on it, but I don't know how to do it. It only works when I type the value.

As you can see in the json code, I tried to add some options in the "action" section, but it is not working.

Is there a way to do this ? Thanks in advance!

 

 

 

 

1 1 382
1 REPLY 1

Are you perhaps looking for this fulfilment

"The info response type is a simple title card that users can click or touch."

nceniza_0-1715292013120.png