Apex SDK for Slack Components

These components are specific to the Apex SDK and don't have Slack block equivalents.

Available in: Surface components

Select a date from a calendar and select a time.

Datetime Picker Example

The date time picker component is a unique type of component; it isn't a surface, layout component, or element.

The date time picker doesn't currently support multiple time zones, which can lead to issues when editing and submitting values. For example, if the field value is stored as 11:00 pm PST on 3/9/2022, the date time picker displays the date and time incorrectly as 11:00 pm on 3/9/2022 for users in EST. The date time picker does not display the time zone or convert the date to the local time zone.

Examples

This example shows a date time picker with a selected date and time.

This example shows various ways to use a date time picker.

Keys

KeyTypeRequiredDescription
definition
StringYesThe value must be datetimepicker.
propertiesObjectYesThe component's properties.
properties.labelString, Plain Text, Expression, ObjectYesAn object containing the labels for the date time picker, or a label for the date time picker.
properties.label.dateString, Plain Text, ExpressionNoA label for the date input of the date time picker.
properties.label.timeString, Plain Text, ExpressionNoA label for the time input of the date time picker.
properties.valueString, ExpressionNoThe initial time that's selected when the date time picker is loaded in the format YYYY-MM-DDThh:mm. The time zone is local to the Slack user client.
properties.requiredBoolean, ExpressionNoIf true, the form can't be submitted when either values in the date time component are empty. The default value is false.
properties.placeholderString, Plain Text, ExpressionNoText used as a placeholder when the value is empty.
properties.nameString, ExpressionYesA name applied to the date time picker. The name is used to retrieve the value on submission. If not specified, a name is automatically generated for you.
properties.confirmConfirm, ExpressionNoA confirmation dialog to display after a date/time is selected.
nameString, ExpressionNoThe name to uniquely identify this component within the view.

Available in: Surface components

This component has been deprecated. We recommend that you use a section layout component and render the field name and value using mrkdwn instead.

Add a field-value pair to your view. A field is an Expression that references a value from a data provider.

The field component is a unique type of component; it isn't a surface, layout component, or element.

Example

Keys

KeyTypeRequiredDescription
definition
StringYesThe value must be field.
propertiesObjectYesThe field's properties.
properties.labelString, ExpressionYesThe label for the field. This value is interpreted as Mrkdwn.
properties.fieldString, ExpressionYesAn expression referencing the field on a record. This value is interpreted as Mrkdwn.
properties.verbatimBoolean, ExpressionNoWhen 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. See Mrkdwn for more details.
properties.disableEncodingBoolean, ExpressionNoAn optional parameter that disables encoding for control characters in Mrkdwn.

Available in: Surface components Operates on: Layout components

To iterate over data in a view, use the iteration component. The iteration component is a unique type of component; it isn't a surface component, layout component, or element component.

The iteration component can contain only layout components. It uses the specified components as a template to display data for each item in a data set.

Examples

This example iterates over a list of records from a data provider.

This example iterates over a list of commands.

This example uses a simple list and a list of maps that are passed into a view.

Keys

KeyTypeRequiredDescription
definition
StringYesThe value must be iteration.
propertiesObjectYesThe component's properties.
properties.foreachExpressionYesThe list to iterate over.
properties.foritemStringYesUsed to refer to the current item in the array of child components.
componentsArrayNoAn array of child components to render inside the iteration.