es.davy.ai

Preguntas y respuestas de programación confiables

¿Tienes una pregunta?

Si tienes alguna pregunta, puedes hacerla a continuación o ingresar lo que estás buscando.

Tarjeta de Bot Framework para mostrar todos los contactos

Actualmente estamos mostrando los 3 contactos principales utilizando Adaptive Card. Ahora necesitamos agregar un botón adicional para mostrar todos los detalles de los contactos. Por favor, ¿alguien puede ayudar a elegir qué tarjeta se debe usar para mostrar todos los detalles de los contactos al hacer clic en el botón?

Tags:  , , , ,

Answer

  1. Avatar for davy.ai

    Para mostrar todos los detalles de los contactos al hacer clic en un botón, podemos utilizar la tarjeta “Action.ShowCard” en Adaptive Cards.

    Aquí tienes un ejemplo de cómo se puede implementar:

    {
       "type":"AdaptiveCard",
       "$schema":"http://adaptivecards.io/schemas/adaptive-card.json",
       "version":"1.0",
       "body":[
          {
             "type":"TextBlock",
             "text":"Top 3 Contactos"
          }
       ],
       "actions":[
          {
             "type":"Action.ShowCard",
             "title":"Mostrar todos los contactos",
             "card":{
                "type":"AdaptiveCard",
                "$schema":"http://adaptivecards.io/schemas/adaptive-card.json",
                "version":"1.0",
                "body":[
                   {
                      "type":"TextBlock",
                      "text":"Todos los Contactos:"
                   },
                   {
                      "type":"ColumnSet",
                      "columns":[
                         {
                            "type":"Column",
                            "width":"stretch",
                            "items":[
                               {
                                  "type":"TextBlock",
                                  "text":"Nombre",
                                  "weight":"bolder"
                               }
                            ]
                         },
                         {
                            "type":"Column",
                            "width":"stretch",
                            "items":[
                               {
                                  "type":"TextBlock",
                                  "text":"Correo electrónico",
                                  "weight":"bolder"
                               }
                            ]
                         }
                      ]
                   },
                   {
                      "type":"ColumnSet",
                      "columns":[
                         {
                            "type":"Column",
                            "width":"stretch",
                            "items":[
                               {
                                  "type":"TextBlock",
                                  "text":"John",
                                  "weight":"lighter"
                               },
                               {
                                  "type":"TextBlock",
                                  "text":"Andy",
                                  "weight":"lighter"
                               },
                               {
                                  "type":"TextBlock",
                                  "text":"Mike",
                                  "weight":"lighter"
                               }
                            ]
                         },
                         {
                            "type":"Column",
                            "width":"stretch",
                            "items":[
                               {
                                  "type":"TextBlock",
                                  "text":"john@example.com",
                                  "weight":"lighter"
                               },
                               {
                                  "type":"TextBlock",
                                  "text":"andy@example.com",
                                  "weight":"lighter"
                               },
                               {
                                  "type":"TextBlock",
                                  "text":"mike@example.com",
                                  "weight":"lighter"
                               }
                            ]
                         }
                      ]
                   }
                ]
             }
          }
       ]
    }
    

    En el ejemplo anterior, el “Action.ShowCard” se activa al hacer clic en el botón para mostrar todos los contactos. La tarjeta contiene un encabezado con el título “Todos los Contactos” y un formato de tabla para mostrar los detalles de contacto. Puedes modificar el contenido de la tarjeta según tus necesidades.

Comments are closed.