When an item is created in monday.com board copy the ID into another column


Get Started

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

About the template


This template demonstrates how to build an automation in monday.co, so when a board item is created, its ID is copied into another column. 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

TypeScriptcopyIdToTextColumn
When an item is created

README


๐Ÿ“‹ Overview

This template demonstrates how to build an automation in monday.com, so when a board item is created, its ID is copied into another column.

๐Ÿ–Š๏ธ Setup

Follow these steps to configure the template with your board:

  1. Open the Set item ID in text column each time a new item is created template.
  2. Click Create a Workspace on the top right corner of the screen.
  3. Review the Workspace name, Description, and Add to a team fields. (You can change these if needed)
  4. Click Create.
  5. On the left side of the screen, under API Connections, select Complete API Connection Setup.
  6. Select your monday.com connector in the Uses connector field.
  7. Click Save.
  8. On the left side of the screen under Event Listeners, select Complete Event Listeners Setup.
  9. Select your monday.com connector in the Uses connector field.
  10. Click Save.
  11. Navigate to Parameters and and edit the following parameters:
    • ITEM_ID_COLUMN_LABEL - Enter the column ID that you want to insert the newly created item ID into.
  12. Click Save.

๐Ÿš€ How to Use

Follow these steps to trigger the script:

  1. Navigate to your monday.com board and create a new item on the board.
  2. Refresh the board and see the Item ID populated.

ItemId Populated

๐Ÿ–Š๏ธ How to modify the script

You could modify this example to add a comment with the Item ID.

API Connections


TypeScriptcopyIdToTextColumn

import Monday from "./api/monday";

export default async function (event: any, 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 { ITEM_ID_COLUMN_LABEL } = context.environment.vars; 
    
    // Extract necessary parameters from the event
    const { pulseId, boardId } = event.event;

    // Check if the necessary parameters are present in the event
    if (!pulseId) {
        throw Error("Pulse ID not present in the event");
    }
    if (!boardId) {
        throw Error("Board ID not present in the event");
    }

    // Get the Item Id out of the webhook event
    const itemId = pulseId.toString();

    // Update the ItemId text column with the Id of the item that was created
    await Monday.Column.changeMultipleColumnValues({
        args: {
            board_id: boardId,
            item_id: itemId,
            column_values: {
                [ITEM_ID_COLUMN_LABEL]: itemId,
            },
        },
        fields: {
            id: true,
        },
    });
}
Documentation ยท Support ยท Suggestions & feature requests