Composition Objects

Some components accept complex property values that must take a certain shape.

Confirm 

A dialog that provides a confirmation step. This dialog asks the user to confirm their action via confirm and deny buttons.

Confirm Example

Example

1confirm:
2  title: "Confirm desired selection"
3  text: "Please confirm your selection"
4  confirm: "Confirm"
5  deny: "Cancel"
6  style: "primary"
KeyTypeRequiredDescription
confirmObjectYesAn object describing a dialog that provides a confirmation step.
confirm.titleString, Expression, Plain TextYesThe title of the confirmation dialog.
confirm.textString, Expression, Plain TextYesExplanatory text to display to the user in the confirmation dialog.
confirm.confirmString, Expression, Plain TextYesThe text of the confirm button.
confirm.denyString, Expression, Plain TextYesThe text of the cancel button.
confirm.styleString, ExpressionNoDefines the color scheme applied to the confirm button. The value danger displays the button with a red background on desktop, or red text on mobile. The value primary displays the button with a green background on desktop, or blue text on mobile. The default value is primary.

Datasource 

Identifies the data provider for an external select component.

Example

1datasource:
2  definition: "example__dataprovider"
3  properties:
4    objectApiName: "Opportunity"
KeyTypeRequiredDescription
datasourceString, Object, ExpressionYesA valid data provider identifier string or object containing an identifier and properties to be passed into a data provider.
datasource.definitionString, Object, ExpressionYesA valid data provider identifier is required to be present within the datasource if the datasource takes the form of an Object. Use the format namespace__dataproviderName.
datasource.propertiesObject, ExpressionNoContains any parameters to be passed into the option data provider.

Filter 

Used in the conversations select component to filter which conversations are shown in the picker.

Example

1filter:
2  include: [ "public", "private", "im", "mpim" ],
3  excludeExternalShared: true,
4  excludeBotUsers: true
KeyTypeRequiredDescription
filterObjectYesUsed in the conversations select component to filter which conversations are shown in the picker.
filter.includeArrayYesList of conversation types to include. Possible values: public—public channels, private—private channels, im—direct messages, mpim—multi-party direct messages.
filter.excludeExternalSharedBoolean, ExpressionNoExclude external shared channels from the conversation list. The default value is false.
filter.excludeBotUsersBoolean, ExpressionNoExclude bot users from the conversation list. The default value is false.

Options 

Available in: Checkbox Group | Overflow | Radio Group | Select

An object that represents a single selectable item.

Example

1options:
2  - identifier: "option_1"
3    label: "Option 1"
4    value: true
5    description: "This is option 1"
6  - identifier: "option_2"
7    label: "Option 2"
8    value: false
KeyTypeRequiredDescription
optionsArray, ExpressionYesA list of options.
options.identifierStringYesA string used to identify the option.
options.labelString, Expression, Plain Text, MrkdwnYesA label for the option on a checkbox group or radio group
String, Expression, Plain TextYesA label for the option on overflow or select.
options.valueBooleanNoThe value of the option. The value key is only available in checkbox groups.
options.descriptionString, Plain Text, ExpressionNoThe description of the option.
options.urlStringNoA URL to load in the user’s browser when the option is selected. The url key is available only in overflow menus.

Option Groups 

Available in: Select

Provides a way to group options in a select component.

Example

1optionGroups:
2  - label: "Option Group 1"
3    options:
4      - identifier: "option_1"
5        label: "Option 1"
6        description: "This is option 1"
7      - identifier: "option_2"
8        label: "Option 2"
9        description: "This is option 2"
10  - label: "Option Group 2"
11    options:
12      - identifier: "option_3"
13        label: "Option 3"
14        description: "This is option 3"
15      - identifier: "option_3"
16        label: "Option 4"
17        description: "This is option 4"
KeyTypeRequiredDescription
optionGroupsArray, ExpressionYesA list of option groups.
optionGroups.labelString, Plain Text, ExpressionYesA label for the group.
optionGroups.optionsArray of OptionsYesSelectable items in the options group.

Text Object 

Many properties accept a string, mrkdwn, or plain text.

For these properties, if the value is a string, the component renders plain text. If the value is an object it must be a Mrkdwn or Plain Text object.

Mrkdwn 

Slack’s implementation of markdown is called mrkdwn.

For more details on formatting with mrkdwn, see Slack’s formatting documentation.

Examples

This example creates mrkdwn text with simple formatting and an emoji.

1text:
2  type: "mrkdwn"
3  text: "This label contains *bold text* and an emoji :smile:."

By default, control characters in markdown are encoded, including the <, >, and & characters. To use control characters in mrkdwn to tag users or denote links, set the disableEncoding property to true.

This example creates mrkdwn text with a link and an emoji. If disableEncoding is false (default), the angular brackets are rendered as they are.

1label:
2  type: "mrkdwn"
3  text: "This label contains a link <https://salesforce.com|salesforce> and an emoji :smile:."
4  disableEncoding: true

This example renders the text http://salesforce.com with a link. The link is automatically parsed because verbatim is set to false. If verbatim is true (default), the text renders without a link.

1components:
2  - definition: section
3    properties:
4      text:
5        type: "mrkdwn"
6        text: "http://salesforce.com "
7        verbatim: false

This example creates mrkdwn text in a section and field component.

1description: "Markdown Support Example"
2schema:
3  properties:
4    boolean_true: # provided as a view property to pass a boolean value instead of a string into the component
5      type: boolean
6      defaultValue: true
7    boolean_false: # provided as a view property to pass a boolean value instead of a string into the component
8      type: boolean
9      defaultValue: false
10components:
11  - definition: modal
12    properties:
13      title:
14        text: "Markdown Example :smile:"
15        emoji: true
16      submitLabel:
17        text: "My Submit"
18        emoji: false
19      closeLabel:
20        text: "My Close :x:"
21        emoji: true
22    components:
23      - definition: header
24        properties:
25          text: "This is a plain_text header."
26      - definition: section
27        properties:
28          text:
29            text: "This is a plain_text section block without emoji support :smile:."
30            emoji: false
31      - definition: section
32        properties:
33          text:
34            text: "This is a plain_text section block with emoji support :smile:."
35            emoji: true
36      - definition: section
37        properties:
38          text:
39            type: "mrkdwn"
40            text: "This is a mrkdwn section block with a link https://salesforce.com and an emoji :smile:. The link is automatically parsed because verbatim is set to false."
41            verbatim: false
42      - definition: section
43        properties:
44          text:
45            type: "mrkdwn"
46            text: "This is a mrkdwn section block with a link https://salesforce.com that will not be automatically parsed because verbatim defaults to true."
47      - definition: section
48        properties:
49          text:
50            text: "*Record:* This field value contains a link https://salesforce.com"
51            type: mrkdwn
52      - definition: section
53        properties:
54          text:
55            text: "*Record:* This field value contains a <https://salesforce.com|link>"
56            type: mrkdwn
57            disableEncoding: true
58      - definition: section
59        properties:
60          text:
61            text: "*Record:* This field value contains a link with encoded control characters: <https://salesforce.com|link>"
62            type: mrkdwn
63      - definition: section
64        properties:
65          text:
66            text: "*A true boolean is rendered as:* {!view.properties.boolean_true}"
67            type: mrkdwn
68      - definition: section
69        properties:
70          text:
71            text: "*A false boolean is rendered as:* {!view.properties.boolean_false}"
72            type: mrkdwn

Keys

KeyTypeRequiredDescription
textObjectYesA text object.
typeStringYesThe value must be mrkdwn.
textStringYesThe text.
verbatimBooleanNoWhen set to false, Slack detects and parses certain values like links in markdown. The default value is true. To turn on automatic parsing, set this key to false. For more information, see Slack’s text object documentation.
disableEncodingBooleanNoBy default (false), control characters are encoded within markdown. To turn off automatic encoding, set this key to true.

Plain Text 

Renders a plain text value with optional support for emojis.

Example

1text:
2  text: "This label can include emojis :smile:."
3  emoji: true

Keys

KeyTypeRequiredDescription
textObjectYesA text object.
typeStringNoThe default value is plain_text.
textStringYesThe text.
emojiBooleanNoSlack doesn’t support emojis in plain text. To turn on emoji support, set this key to true. For more information, see Slack’s text object documentation.

Beta Feature

This feature is not generally available. It is not part of your purchased Services. This feature is subject to change, may be discontinued with no notice at any time in SFDC’s sole discretion, and SFDC may never make this feature generally available. Make your purchase decisions only on the basis of generally available products and features. This feature is made available on an AS IS basis and use of this feature is at your sole risk.