How to create template for MS teams

chatbots

(vaibhav kansal) #1

Hi Team,
After enable the Chat bot in MS teams Channel .
most of template is not rendering properly. only list of enumeration is selected is working in case of data list should be less then 10. can we extent this number by configuration?
Also how to create specific template for MS teams. because i have create json for MS teams but is not rendering.
Can you pls send me some sample through which i will be able to run my bot on Teams Channel as well.

Thanks
Vaibhav


(Swagat) #2

@vaibhav.kansal
Every channel has its own documentation managed by the channel owner. You will need to refer to MS Teams documentation. Kore.ai only maintains Kore specific channel documentation on templates etc.
Please refer to this. It may be helpful. I tried adaptive template as described and it works.
https://docs.microsoft.com/en-us/adaptive-cards/getting-started/bots

Also, all messages, list etc. may have channel level constraints which are not controlled by Kore.ai. Please design your bot accordingly.


(vaibhav kansal) #3

I have tried that adaptive card code as per your suggestion.
but nothing is rendering in MS teams.
Could you pls share the same Java script code which is working with adaptive card in MS teams.

Thanks
Vaibhav


(Swagat) #4

@vaibhav.kansal
In case you have configured ALL channel response it will not work in ms teams. You will need a channel specific over-ride. Here is my sample code.

image


//url: https://docs.microsoft.com/en-us/adaptive-cards/getting-started/bots
var msg = {
  "type": "message",
  "text": "Plain text is ok, but sometimes I long for more...",
  "attachments": [
    {
      "contentType": "application/vnd.microsoft.card.adaptive",
      "content": {
        "type": "AdaptiveCard",
        "version": "1.0",
        "body": [
          {
            "type": "TextBlock",
            "text": "Hello World!",
            "size": "large"
          },
          {
            "type": "TextBlock",
            "text": "*Sincerely yours,*"
          },
          {
            "type": "TextBlock",
            "text": "Adaptive Cards",
            "separation": "none"
          }
        ],
        "actions": [
          {
            "type": "Action.OpenUrl",
            "url": "http://adaptivecards.io",
            "title": "Learn More"
          }
        ]
      }
    }
  ]
};
print(JSON.stringify(msg));

(vaibhav kansal) #5

Thanks for Quick response.
i have tried to use adaptive card for Microsoft teams and it’s rendering properly.
i have an issue while click on submit i am not able to get value and also value is setting on entity. that’s why i will not be able to move next entity or message.i am attaching my code.

var message = {
“type”: “message”,
“speak”: “”,
“text”: "please select Primary Contact : ",
“attachments”: [
{
“contentType”: “application/vnd.microsoft.card.adaptive”,
“content”: {
“type”: “AdaptiveCard”,
“version”: “1.0”,
“body”: [
{
“type”: “TextBlock”,
“text”: "please select Primary Contact : "
},
{
“type”: “Input.ChoiceSet”,
“id”: “myColor”,
“style”: “compact”,
“isMultiSelect”: false,
“value”: “1”,
“choices”: [
{
“title”: “Contact1”,
“value”: “Contact1”
},
{
“title”: “Contact2”,
“value”: “Contact2”
},
{
“title”: “Contact3”,
“value”: “Contact3”
},
{
“title”: “Contact4”,
“value”: “Contact4”
}
]
},
],
“actions”: [
{
“type”: “Action.Submit”,
“title”: “Submit”,
“data”: “Primary Contact”
}
]
}
}
]
}

print(JSON.stringify(message));
when clicks on submit nothing happens.
Please tell me how do i get selected value and set that value on current entity.

Thanks
Vaibhav


(Swagat) #7

@vaibhav.kansal
What I understand is for adaptive card, submit reaches Kore in a totally different format which is not currently supported.
The Kore channel adapter would look for text and attachment. We are getting it in ‘Object’. This has been taken up for enhancement.

Please note that Kore.ai does not have control on the changes in formats at Channel end and hence it may not be possible to keep up to date always. We do understand the inconvenience faced at your end but as of now, we do not have any ETA.