How to Integrate Zoho Projects with Zoho CRM Using Deluge Script

How to fetch custom field API names in Zoho Projects and create a project from Zoho CRM using Deluge script.

Introduction

Managing projects and customer relationships in separate tools often leads to data silos, manual effort, and communication gaps. If your team uses both Zoho Projects and Zoho CRM, connecting the two with automation can dramatically reduce repetitive work and improve visibility across your pipeline.

In this tutorial, you will learn exactly how to fetch custom field API names from Zoho Projects and use them inside a Deluge script to automatically create a new project in Zoho Projects — triggered directly from a deal record in Zoho CRM.

In this post,

  1. Why Integrate Zoho Projects with Zoho CRM?
  2. Prerequisites
  3. Step 1 — Set Up Custom Fields in Zoho Projects
  4. Step 2 — Fetch Custom Field API Names via REST API
  5. Step 3 — Create a Connection in Zoho CRM
  6. Step 4 — Write the Deluge Script
  7. Step 5 — Test and Deploy the Function
  8. Tips, Troubleshooting & Best Practices
  9. Conclusion

Why Integrate Zoho Projects with Zoho CRM?

When a sales deal is closed or moves to a specific stage, your operations team typically needs to kick off a corresponding project. Without automation, this means someone manually reads the CRM, copies details, and creates the project by hand — a process that is slow and error-prone.

By connecting Zoho CRM and Zoho Projects through Deluge scripting and the Zoho Projects REST API, you can:

  • Automatically create projects when a deal reaches a certain stage
  • Map deal fields (such as deal name, dates, and custom data) directly to project fields
  • Eliminate manual data entry and reduce human error
  • Give project managers instant visibility as soon as a deal closes
  • Maintain consistent data across both platforms

Who is this guide for?

This tutorial is written for Zoho administrators, CRM consultants, and developers who are comfortable with basic Zoho CRM settings. No advanced programming experience is required — Deluge is a beginner-friendly scripting language built into the Zoho ecosystem.

Prerequisites

Before you begin, make sure you have the following in place:

  • Active subscriptions to both Zoho CRM and Zoho Projects
  • Administrator-level access in both applications
  • Your Zoho Projects portal name (visible in your Zoho Projects URL)
  • Your Zoho Projects portal ID (retrieved from your portal settings or the API)
  • Basic understanding of how Zoho CRM layouts and custom fields work

Data centre note:

The API base URL used in this guide is https://projectsapi.zoho.in — this is for India-region accounts. If your Zoho account is in a different region (US, EU, AU, etc.), you will need to replace .in with the appropriate domain extension (e.g., .com for US accounts).

Step 1 — Set Up Custom Fields in Zoho Projects

Custom fields allow you to capture information unique to your business inside Zoho Projects. For this integration, we will add fields to the Projects layout so that deal-specific data from Zoho CRM can be stored alongside each project.

How to add custom fields in Zoho Projects

  1. Log in to your Zoho Projects account and open your portal.
  2. Click the Settings icon (gear icon) in the top navigation bar.
  3. Navigate to the Customization tab in the settings menu.
  4. Under Layouts & Fields, select Projects to edit the project layout.
  5. Click Add Section to create a logical grouping for your new fields. For this example, name it Projection Details.
  6. Within that section, add the fields your business needs. In our example, we add: No. of Repeated Orders, Repeat Frequency, Repeat Order Date, and Project Timeline Status.
  7. Save your layout changes.


Tip:
Choose field types carefully — use Date for date values, Single Line or Dropdown for text/status fields, and Number for integer values. The type determines the UDF prefix assigned to the field API name.

Step 2 — Fetch Custom Field API Names via REST API

Once custom fields are created, Zoho Projects automatically assigns each field an internal API name in the format UDF_CHAR1, UDF_DATE1, and so on. You cannot see these names in the UI — you must retrieve them using the Zoho Projects REST API.

The API endpoint to use

Make a GET request to the following URL, replacing {portal_name} with your actual portal name:

https://projectsapi.zoho.in/restapi/portal/{portal_name}/projects/customfields/

Replace {portal_name} with your portal’s actual name.For example, if your portal name is honecoredotcom, the URL would be:

https://projectsapi.zoho.in/restapi/portal/honecoredotcom/projects/customfields/

This API call will return the list of API names for the custom fields, which will be needed in the Deluge script.

API Link : https://www.zoho.com/projects/help/rest-api/projects-api.html#alink3

You can test this directly in your browser (if you are logged in to Zoho) or using a tool such as Postman. The response will be a JSON object listing all custom fields associated with your Projects layout, including each field's display name and its API name.

Example: Custom field API names returned

For our example portal, the API returned the following mappings that we will use in the Deluge script:
Field Label (Display Name)Field TypeAPI Name
No. of Repeat OrdersSingle Line TextUDF_CHAR6
Repeat FrequencySingle Line TextUDF_CHAR9
Repeat Order DateDateUDF_DATE1
Project Timeline StatusSingle Line TextUDF_CHAR17
Estimated Target BOMSingle Line TextUDF_CHAR1


Important:The API names shown above are specific to the portal used in this example. Your portal will return different values. Always retrieve the API names from your own portal before writing the Deluge script.


Step 3 — Create an API Connection in Zoho CRM

To call the Zoho Projects API from within a Deluge script in Zoho CRM, you need to set up a Connection. This securely stores your OAuth credentials and allows the script to make authorized API calls.

  1. In Zoho CRM, click the Settings icon and go to Developer Hub.
  2. Under Developer Hub, click Connections and then New Connection.
  3. Choose Zoho OAuth as the connection type.
  4. Give the connection a name — in this guide, we use "zcrm".
  5. Under Scopes, add the following scope: zoho.projects.ALL. This grants the script full access to your Zoho Projects data.
  6. Click Create and Connect and authorize the connection through your Zoho account

Security tip:
If you want to follow the principle of least privilege, you can use more specific scopes such as zoho.projects.CREATE and zoho.projects.READ instead of zoho.projects.ALL, depending on what your function needs to do.

Step 4 — Write the Deluge Script

Now that you have your custom field API names and an authorized connection, you are ready to write the Deluge function. This function will:

  • Fetch the deal record from Zoho CRM using the Deal ID
  • Build a map of project parameters, including standard and custom fields
  • Call the Zoho Projects API to create a new project with those parameters


Creating the function in Zoho CRM

  1. In Zoho CRM, go to Settings → Developer Hub → Functions.
  2. Click New Function. Give it a descriptive name such as "Create_Project_From_Deal".
  3. Set the function argument to accept a Dealid parameter (type: String).
  4. Paste the Deluge code below into the editor.


Sample Deluge Code

Here is a sample Deluge script to fetch the deal details from Zoho CRM and create a new project in Zoho Projects:

deluge

// Fetch the deal details from Zoho CRM
getDeal = zoho.crm.getRecordById("Deals", Dealid); // Fetch custom field API names from Zoho Projects GetProjectDetails = invokeurl [ url :"https://projectsapi.zoho.in/restapi/portal/honecoredotcom/projects/customfields/" type :GET connection:"zcrm" ]; info GetProjectDetails; // Map project details mp = Map(); mp.put("name", ifnull(getDeal.get("Deal_Name"), "")); // Project Name mp.put("owner_zpuid", "205165000000032021"); // Project Owner mp.put("start_date", zoho.currentdate.toString("MM-dd-yyyy")); // Start Date mp.put("end_date", zoho.currentdate.addDay(3).toString("MM-dd-yyyy")); // End Date // Custom Fields mp.put("UDF_CHAR6", ifnull(getDeal.get("Projections"), "")); // No. of Repeat Orders if (!isNull(getDeal.get("Projection_Date"))) { mp.put("UDF_DATE1", ifnull(getDeal.get("Projection_Date").toDate(), "")); // Repeat Order Date } mp.put("UDF_CHAR9", ifnull(getDeal.get("Projection_Term"), "")); // Repeat Frequency mp.put("UDF_CHAR1", ifnull(getDeal.get("Estimated_Target_BOM"), "")); // Estimated Target BOM // Call the Zoho Project API to Create the Project portalname = "honecoredotcom"; portalID = "60025983370"; projectsAPIEndPoint = "https://projectsapi.zoho.in/restapi"; url = projectsAPIEndPoint + "/portal/" + portalID + "/projects/"; resp = invokeurl [ url : url type : POST parameters: mp connection: "zcrm" ]; info resp;

Output :-


x

Note:- My Project Standard Layout Custom field API names which I got through the Api Hit :-

(url :"https://projectsapi.zoho.in/restapi/portal/"+"honecoredotcom"+"/projects/customfields/")


Understanding each section of the script

Fetching the deal — The zoho.crm.getRecordById function retrieves all fields from a specific deal. You pass in the Dealid argument, which is provided when the function is triggered (for example, from a workflow or a button in the CRM).

Building the parameters map — A Deluge Map is a key-value collection. Each mp.put() call adds one field to the project creation request. Standard fields like name, owner_zpuid, start_date, and end_date are defined by the Zoho Projects API. Custom fields use their UDF API names.

Handling null values — The ifnull(value, "") pattern ensures that if a CRM field is empty, an empty string is sent instead of causing a script error.

Calling the API — The invokeurl block sends a POST request to the Zoho Projects endpoint. The connection parameter tells the script which stored OAuth connection to use for authentication.


Step 5 — Test and Deploy the Function

Testing the function

  1. In the Deluge editor, click Test at the top of the page.
  2. When prompted, enter a valid Deal ID from your Zoho CRM. You can find this in the deal's URL (the long number at the end).
  3. Click Execute and review the output in the logs panel.
  4. A successful response will include a projects array in the output with the newly created project's details.
  5. Log in to Zoho Projects and confirm the project appears with the correct name and custom field values.

Triggering the function automatically

Once tested, you can attach this function to a Zoho CRM workflow so it runs automatically. For example, you can trigger it when a deal's Stage field changes to Closed Won:

  1. Go to Settings → Automation → Workflows and create a new workflow for the Deals module.
  2. Set the workflow trigger condition to Stage is changed to Closed Won.
  3. Under Actions, select Custom Function and choose your function.
  4. Map the Dealid argument to ${Deals.Id}.
  5. Save and activate the workflow.


Tips, Troubleshooting & Best Practices

Common issues and how to fix them

1. Error: "Invalid OAuth token"
— This usually means the connection was not authorized properly. Go back to your connection settings, click Re-authorize, and make sure the scope zoho.projects.ALL is listed.

2. Error: "Field does not exist"
— You may be using an incorrect UDF API name. Re-run the custom fields endpoint for your portal and double-check the values returned. Remember that UDF names are unique to each portal.

3. Project created but custom fields are empty
— Verify that the CRM field names used in getDeal.get("FieldName") exactly match your CRM API field names. You can find the correct API names under Settings → Customization → Modules and Fields in Zoho CRM.

Best practices for production use

  • Store your portal ID and portal name as Zoho CRM custom variables rather than hardcoding them in the script — this makes future updates easier.
  • Add error handling using if (resp.get("error") != null) to catch and log API failures gracefully.
  • Use the Zoho Projects API documentation to understand all available fields for the project creation endpoint before building complex scripts.
  • Test in a sandbox environment before deploying to production, especially if the workflow will trigger on a high volume of deals.
  • Keep the info GetProjectDetails debug call commented out in production — it adds unnecessary API calls.

Conclusion

Connecting Zoho Projects with Zoho CRM through Deluge scripting is a powerful way to eliminate manual handoffs between your sales and delivery teams. By following this guide, you have learned how to:

  • Create and manage custom fields in the Zoho Projects layout
  • Retrieve internal API names using the Zoho Projects REST API
  • Build a secure, authorized connection between Zoho CRM and Zoho Projects
  • Write and test a Deluge function that creates a project from a deal record
  • Automate the entire flow using Zoho CRM workflows

With this foundation in place, you can expand the integration further — for example, updating the project when the deal is updated, or writing back the project URL to the CRM deal record for easy cross-referencing.

Post a Comment