Jan 27 2022 08:35 PM
hello, I have a bot in teams that sends an action card with options on buttons, the problem is that the texts of the buttons are cut off:
hello, I have a bot in teams that sends an action card with options on buttons, the problem is that their texts are cut off as seen in the images
I do not use adaptive card because they limit me to only 6 buttons and I require more, on the other hand it does not have the functionality to navigate the options to the sides
I need the text to be complete in several lines or have a tooltip that shows the complete text
The code I use to send the action card is:
var herocard = new HeroCard();
herocard.Title = answers[0].Answer;
List<CardAction> buttons = new List<CardAction>();
var sortedPrompts = prompts.OrderBy(r => r.DisplayText);
foreach (var items in sortedPrompts)
{
buttons.Add(new CardAction()
{
Type = ActionTypes.MessageBack,
Title = items.DisplayText,
DisplayText = items.DisplayText,
Text = items.DisplayText,
Value = items.DisplayText,
});
}
herocard.Buttons = buttons;
var response = stepContext.Context.Activity.CreateReply();
response.Attachments = new List<Microsoft.Bot.Schema.Attachment>() { herocard.ToAttachment() };
await stepContext.Context.SendActivityAsync(response);
I welcome your comments and help.
Jan 28 2022 12:06 AM
Feb 01 2022 04:08 AM
@rosrene - We are tried it from our end ,It's working fine for us. Could you please try it once as per given code snippet:-
public static HeroCard GetHeroCard()
{
var heroCard = new HeroCard
{
Title = "Hero Card",
Text = "from text/sms to Skype, Slack, Office 365 mail and other popular services.",
Buttons = new List<CardAction> { new CardAction(ActionTypes.OpenUrl, "Learn More", value: "http://www.devenvexe.com"), new CardAction(ActionTypes.OpenUrl, "C# Corner", value: "http://www.c-sharpcorner.com/members/suthahar-j"), new CardAction(ActionTypes.OpenUrl, "MSDN", value: "https://social.msdn.microsoft.com/profile/j%20suthahar/"), new CardAction(ActionTypes.OpenUrl, "Remove subscription button don't take any action when user pressed enter via ", value: "https://social.msdn.microsoft.com/profile/j%20suthahar/") }
};
return heroCard;
}
Microsoft Teams Version 1.5.00.2567 (64-bit)
Let us know if you have any query.
Feb 01 2022 01:41 PM
Hello, try to place the code above and continue in the same way.
The code I used was:
var heroCard = new HeroCard
{
Title = "Hero Card",
Text = "from text/sms to Skype, Slack, Office 365 mail and other popular services.",
Buttons = new List<CardAction> { new CardAction(ActionTypes.OpenUrl, "Learn More", value: "http://www.devenvexe.com"), new CardAction(ActionTypes.OpenUrl, "C# Corner", value: "http://www.c-sharpcorner.com/members/suthahar-j"), new CardAction(ActionTypes.OpenUrl, "MSDN", value: "https://social.msdn.microsoft.com/profile/j%20suthahar/"), new CardAction(ActionTypes.OpenUrl, "Remove subscription button don't take any action when user pressed enter via ", value: "https://social.msdn.microsoft.com/profile/j%20suthahar/") }
};
var reply = MessageFactory.Attachment(heroCard.ToAttachment());
await stepContext.Context.SendActivityAsync(reply, cancellationToken);
However, the images and cards look like this:
Feb 02 2022 03:01 AM
Feb 02 2022 03:02 AM
Feb 02 2022 04:02 AM
Feb 03 2022 12:50 AM
Feb 04 2022 03:57 AM
Feb 07 2022 03:45 AM
@rosrene - Using the above code when you hover the mouse on button It will show whole text.Could you check it once?
Microsoft Teams Version 1.5.00.3154 (64-bit)
Feb 08 2022 03:28 AM
Feb 08 2022 03:40 AM
Feb 08 2022 03:44 AM
Feb 08 2022 05:33 AM
Feb 08 2022 05:42 AM - edited Feb 08 2022 05:49 AM
@rosrene- Please have a look at this documents- 1. https://github.com/microsoft/BotBuilder-Samples/blob/main/samples/csharp_dotnetcore/06.using-cards/C...
2. https://github.com/microsoft/BotBuilder-Samples/blob/main/samples/csharp_dotnetcore/50.teams-messagi...
Let us know if you have any query.
Feb 08 2022 09:23 PM
Feb 15 2022 09:22 PM
Hi @Sayali-MSFT,
Sorry for the delay, I have been doing several tests and I identified that:
the example provided from the repository https://github.com/microsoft/BotBuilder-Samples/blob/main/samples/csharp_dotnetcore/06.using-cards/C... works correctly and the tooltip is seen in long texts
in this example the action type is an OpenURL
if the action type is changed to messageback which we need, then the tooltip doesn't appear
I think that now we have the concrete cause, we need to see how to solve it
Thanks
Feb 18 2022 02:55 AM - edited Feb 21 2022 04:18 AM
@rosrene - There doesn't seem to be any alternative for this.