Forum Discussion
rosrene
Jan 28, 2022Brass Contributor
Action Card Teams wrap text button
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 acti...
Sayali-MSFT
Microsoft
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.
fmolina5656
Feb 01, 2022Copper Contributor
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:
- Sayali-MSFTFeb 02, 2022Microsoftfmolina5656 - Your issue has resolved with above suggestion or still looking for any help?
- Sayali-MSFTFeb 03, 2022Microsoftfmolina5656 - here as you mention the button text wrapping properly in card. Could you just confirm the card is render as per you expected(Wrap Text) or looking any help?