Share via


SubmitAction class

Gathers input values, merges them with the data property if specified, and sends them to the Bot via an Invoke activity. The Bot can only acknowledge is has received the request. Action.Submit only works in Teams.

Constructors

SubmitAction(SubmitActionOptions)

Properties

associatedInputs

The Ids of the inputs associated with the Action.Submit. When the action is executed, the values of the associated inputs are sent to the Bot. See Input validation for more details.

conditionallyEnabled

Controls if the action is enabled only if at least one required input has been filled by the user.

data

The data to send to the Bot when the action is executed. The data specified in the card payload will be sent back to the Bot as is, alongside the values of the inputs expressed as key/value pairs where the key is the Id of the input.

fallback

An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.

iconUrl

A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title.

iconUrl also accepts the <icon-name>[,regular|filled] format to display an icon from the vast Adaptive Card icon catalog instead of an image.

id

A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.

isEnabled

Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state.

mode

Controls if the action is primary or secondary. Secondary actions appear in an overflow menu.

msTeams

Teams-specific metadata associated with the action.

requires

A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).

style

Control the style of the action, affecting its visual and spoken representations.

title

The title of the action, as it appears on buttons.

tooltip

The tooltip text to display when the action is hovered over.

type

Must be Action.Submit.

Methods

from(Omit<ISubmitAction, "type">)
withAssociatedInputs("auto" | "none")
withConditionallyEnabled(boolean)
withData(any)
withFallback(FallbackAction)
withIconUrl(string)
withId(string)
withIsEnabled(boolean)
withMode(ActionMode)
withMsTeams(ITeamsSubmitActionProperties)
withRequires(IHostCapabilities)
withStyle(ActionStyle)
withTitle(string)
withTooltip(string)

Constructor Details

SubmitAction(SubmitActionOptions)

new SubmitAction(options?: SubmitActionOptions)

Parameters

Property Details

associatedInputs

The Ids of the inputs associated with the Action.Submit. When the action is executed, the values of the associated inputs are sent to the Bot. See Input validation for more details.

associatedInputs?: "auto" | "none"

Property Value

"auto" | "none"

conditionallyEnabled

Controls if the action is enabled only if at least one required input has been filled by the user.

conditionallyEnabled?: boolean

Property Value

boolean

data

The data to send to the Bot when the action is executed. The data specified in the card payload will be sent back to the Bot as is, alongside the values of the inputs expressed as key/value pairs where the key is the Id of the input.

data?: any

Property Value

any

fallback

An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.

fallback?: FallbackAction

Property Value

iconUrl

A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title.

iconUrl also accepts the <icon-name>[,regular|filled] format to display an icon from the vast Adaptive Card icon catalog instead of an image.

iconUrl?: string

Property Value

string

id

A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.

id?: string

Property Value

string

isEnabled

Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state.

isEnabled?: boolean

Property Value

boolean

mode

Controls if the action is primary or secondary. Secondary actions appear in an overflow menu.

mode?: ActionMode

Property Value

msTeams

Teams-specific metadata associated with the action.

msTeams?: ITeamsSubmitActionProperties

Property Value

requires

A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).

requires?: IHostCapabilities

Property Value

style

Control the style of the action, affecting its visual and spoken representations.

style?: ActionStyle

Property Value

title

The title of the action, as it appears on buttons.

title?: string

Property Value

string

tooltip

The tooltip text to display when the action is hovered over.

tooltip?: string

Property Value

string

type

Must be Action.Submit.

type: "Action.Submit" = "Action.Submit"

Property Value

"Action.Submit"

Method Details

from(Omit<ISubmitAction, "type">)

static function from(options: Omit<ISubmitAction, "type">): SubmitAction

Parameters

options

Omit<ISubmitAction, "type">

Returns

withAssociatedInputs("auto" | "none")

function withAssociatedInputs(associatedInputs: "auto" | "none"): SubmitAction

Parameters

associatedInputs

"auto" | "none"

Returns

withConditionallyEnabled(boolean)

function withConditionallyEnabled(conditionallyEnabled?: boolean): SubmitAction

Parameters

conditionallyEnabled

boolean

Returns

withData(any)

function withData(data: any): SubmitAction

Parameters

data

any

Returns

withFallback(FallbackAction)

function withFallback(fallback: FallbackAction): SubmitAction

Parameters

fallback
FallbackAction

Returns

withIconUrl(string)

function withIconUrl(iconUrl: string): SubmitAction

Parameters

iconUrl

string

Returns

withId(string)

function withId(id: string): SubmitAction

Parameters

id

string

Returns

withIsEnabled(boolean)

function withIsEnabled(isEnabled?: boolean): SubmitAction

Parameters

isEnabled

boolean

Returns

withMode(ActionMode)

function withMode(mode: ActionMode): SubmitAction

Parameters

mode
ActionMode

Returns

withMsTeams(ITeamsSubmitActionProperties)

function withMsTeams(msTeams: ITeamsSubmitActionProperties): SubmitAction

Parameters

Returns

withRequires(IHostCapabilities)

function withRequires(requires: IHostCapabilities): SubmitAction

Parameters

Returns

withStyle(ActionStyle)

function withStyle(style: ActionStyle): SubmitAction

Parameters

style
ActionStyle

Returns

withTitle(string)

function withTitle(title: string): SubmitAction

Parameters

title

string

Returns

withTooltip(string)

function withTooltip(tooltip: string): SubmitAction

Parameters

tooltip

string

Returns