# Slack Notification Action

Send a Slack notification.

The Slack Notification Action sends a message to the specified Slack Incoming Webhook URL.

## Configuration

### Condition

In the **Action Condition** section, you can specify the conditions under which the action will be executed using the values (Message or Context) from the event source to the channel. For more details on the expressions you can input, refer to [Use Expressions in Actions](https://docs.soracom.io/en/services/flux/action-expressions).

In this input field, you can enter expressions representing data related to the trigger that starts the Flux application (e.g., `event.payload.temp`) or data related to the channel where the action is added (e.g., `payload.temp`).

### Config

**URL**

Enter the Slack Incoming Webhook URL.

**Payload**

Enter the content to be sent to the Slack Incoming Webhook. Click **Advanced Settings** or **Simple Mode** to specify the format of the content to be sent.

- **Simple Mode**: The message you enter will be sent as **plain text** to the Incoming Webhook URL, as described in Slack API's [Use your incoming webhook URL to post a message](https://api.slack.com/messaging/webhooks#posting_with_webhooks).
- **Advanced Settings**: The content will be sent as the HTTP body to the Incoming Webhook URL, as described in Slack API's [Sending messages using incoming webhooks](https://api.slack.com/messaging/webhooks).

In this input field, you can enter expressions representing data related to the trigger that starts the Flux application (e.g., `${event.payload.temp}`) or data related to the channel where the action is added (e.g., `${payload.temp}`). For details on supported expressions, refer to [Action Config Expressions](https://docs.soracom.io/en/services/flux/action-expressions#action-config-expressions).

### Output

Configure how to handle the output data of the action. Refer to [Enable Republishing of Action Output](https://docs.soracom.io/en/services/flux/action-output#enable-republishing-of-action-output) for more details.

## Output Data of the Action

The output data of the Slack Notification Action is as follows:

- If a successful response (`20x` response code) is returned from the Slack API, the output is `ok`.
- If a non-successful response code is returned from the Slack API, the output is the error message returned by Slack.
