CardAction Class

Definition

A card action represents a clickable or interactive button for use within cards or as suggested actions. They are used to solicit input from users.Despite their name, card actions are not limited to use solely on cards.

Card actions are meaningful only when sent to channels.

Channels decide how each action manifests in their user experience.In most cases, the cards are clickable. In others, they may be selected by speech input.In cases where the channel does not offer an interactive activation experience (e.g., when interacting over SMS), the channel may not support activation whatsoever.The decision about how to render actions is controlled by normative requirements elsewhere in this document (e.g.within the card format, or within the suggested actions definition).

C#
public class CardAction
Inheritance
CardAction
Derived

Constructors

CardAction()

Initializes a new instance of CardAction.

CardAction(String, String, String, String, String, Object, Object, String)

Initializes a new instance of CardAction.

Properties

ChannelData

Channel-specific data associated with this action.

DisplayText

(Optional) text to display in the chat feed if the button is clicked.

Image

Image URL which will appear on the button, next to text label.

ImageAltText

Alternate text to be used for the Image property.

Text

Text for this action.

Title

Text description which appears on the button.

Type

Defines action types for clickable buttons. See ActionTypes.

Value

Supplementary parameter for action. Content of this property depends on the ActionType.

Methods

FromString(String)

Creates a CardAction from the given input.

Operators

Implicit(String to CardAction)

Implicit conversion of string to CardAction to simplify creation of CardActions with string values.

Applies to

Product Versions
Microsoft 365 Agents SDK .NET 1