First you’ll need to prepare Slack to receive incoming webhooks. Then you’ll create an action in TableFlow that triggers this newly created webhook in Slack.

Configure Incoming Webhook in Slack

Slack offers a handy feature that enables developers to use webhooks to send messages. Slack calls these “apps”, but in this case they’re really just lightweight actions.

1. Create Slack App

Follow this link and click the “Create New App” button to get started. Then select “From scratch” to continue to the configuration page. Slack Create New App

2. Configure App

You can name the app anything you like, but we suggest “TableFlow”. Then select the Slack Workspace where the messages will be sent. Slack Configure App

3. Activate Webhook Functionality

Under the “Features and functionality” section, find and click on the “Incoming Webhooks” option. Find the “Activate Incoming Webhooks” setting and switch the toggle to “On”. Slack Add Webhook

4. Add New Webhook

Scroll to the bottom of the page and select “Add New Webhook to Workspace”. Slack Add New Webhook

6. Select Slack Channel

Using the dropdown, select the channel that you would like messages to be delivered. Slack Select Channel

7. Copy Webhook URL

Great, now you’ve got a Slack App that’s ready to receive incoming webhooks. Scroll to the bottom of the “Incoming Webhooks” page and use the “Copy” button to copy the webhook URL. Slack Copy Webhook URL

Create TableFlow Webhook

Now that you’ve got the incoming webhook ready in Slack, you can now trigger it from TableFlow.

1. Add Endpoint

Navigate to the “Webhooks” section of the TableFlow settings and click the “Add Endpoint” button. Webhooks Settings

2. Set Slack Webhook URL

Paste the Slack Webhook URL from the section above into the Endpoint URL field. Then scroll to the bottom of the page and click “Create”. Set Slack URL

3. Enable Transformations

Navigate to the “Advanced” section of the endpoint settings and find “Transformations”. Toggle on the “Enabled” switch. Enable Transformations

4. Edit Transformation Code

Click “Edit transformation” and find the code block to modify the webhook payload. Update the handler to the code below and click “Save”.

function handler(webhook) {

  webhook.payload = {"text": "TableFlow Import Completed - number of rows: " + webhook.payload.num_rows}

  return webhook
}

Try It Out 🎉

That’s it! If everything’s set up correctly, you should be good to go. Import a new file and check to see if your new Slack app sent a message to the channel you defined.