Post to Slack when an item is created in monday.com board


Get Started

Not the template you're looking for? Browse more.

About the template


This template demonstrates how to send a message to a Slack channel when an item is created in a monday.com board. Get started to learn more.

About ScriptRunner Connect


What is ScriptRunner Connect?

ScriptRunner Connect is an AI assisted code-first (JavaScript/TypeScript) integration platform (iPaaS) for building complex integrations and automations.

Can I try it out for free?

Yes. ScriptRunner Connect comes with a forever free tier.

Can I customize the integration logic?

Absolutely. The main value proposition of ScriptRunner Connect is that you'll get full access to the code that is powering the integration, which means you can make any changes to the the integration logic yourself.

Can I change the integration to communicate with additional apps?

Yes. Since ScriptRunner Connect specializes in enabling complex integrations, you can easily change the integration logic to connect to as many additional apps as you need, no limitations.

What if I don't feel comfortable making changes to the code?

First you can try out our AI assistant which can help you understand what the code does, and also help you make changes to the code. Alternatively you can hire our professionals to make the changes you need or build new integrations from scratch.

Do I have to host it myself?

No. ScriptRunner Connect is a fully managed SaaS (Software-as-a-Service) product.

What about security?

ScriptRunner Connect is ISO 27001 and SOC 2 certified. Learn more about our security.

Template Content


README

Scripts

TypeScriptOnMondayWhenAnItemIsCreated
When an item is created

README


๐Ÿ“‹ Overview

This template demonstrates how to send a message to a Slack channel when an item is created in a monday.com board.

๐Ÿ–Š๏ธ Setup

  • Configure the API Connection and Event Listener by creating a connector for monday.com and Slack, or use existing ones.
  • Go to Parameters and change the SLACK_CHANNEL parameter to appropriate value for your instance.

๐Ÿš€ Usage

Create a new item in a monday.com board, after successful event processing a new message should be sent to the pre-defined Slack channel.

API Connections


TypeScriptOnMondayWhenAnItemIsCreated

import { CreateItemEvent } from '@sr-connect/monday/events';
import Slack from './api/slack';

/**
 * Entry point to when "an item is created" event is triggered
 *
 * @param event Object that holds When an item is created event data
 * @param context Object that holds function invocation context data
 */
export default async function (event: CreateItemEvent, context: Context): Promise<void> {
    if (context.triggerType === 'MANUAL') {
        console.error('This script is designed to be triggered externally or manually from the Event Listener. Please consider using Event Listener Test Event Payload if you need to trigger this script manually.');
        return;
    }

    const envVars = context.environment.vars as EnvVars;

    // Check if the pulse name is present in the event
    if (!event.event.pulseName) {
        throw Error('Item name is not present in the event');
    }

    // Send a message to pre-defined Slack channel
    await Slack.Chat.postMessage({
        body: {
            channel: envVars.SLACK_CHANNEL,
            text: `${event.event.pulseName} has been created in monday.com`
        }
    });
}

interface EnvVars {
    SLACK_CHANNEL: string;
}
Documentation ยท Support ยท Suggestions & feature requests