Why Can't I See Custom Modules in 'Create Object' Step in Zoho CRM Workflow?

This topic was automatically generated from Slack. You can find the original thread here.

Hi all, I’m trying to update a custom module in Zoho CRM as part of a workflow, but I can’t see any of my custom modules when using the ‘Create Object’ step, only the default ones. What’s weird is that I can list the Custom Modules fine and I can see the Custom Modules when I try to use them as a source for an event trigger. Am I doing something wrong here?

It looks like the Module prop for Zoho CRM is currently just using a static list of module options, instead of fetching them dynamically. pipedream/zoho_crm.app.mjs at master · PipedreamHQ/pipedream · GitHub

But yea, I see we do list them for the sources: pipedream/new-event.mjs at master · PipedreamHQ/pipedream · GitHub

Sounds like we should update the action(s) to also fetch them dynamically

Makes sense. So in the meantime, is it possible to pass the custom module that I want using a custom expression?

Unfortunately for that action I don’t think it is, since it’s configured to render additional prop inputs dynamically, based on the module you select. So we won’t know what fields to render for a custom module.

Btw here is the ticket to track that fix: Update Zoho CRM · Issue #6228 · PipedreamHQ/pipedream · GitHub

Love it, thanks Danny for the speeedy response!

But I bet this is achievable either with a custom HTTP request or a Node step.

Let’s see if our support bot, Mario can help…

Actually, we have a couple AI tools we’re prototyping that might be able to help. I’m going to try one now and will post the response in a second.

Can you try adding a Node.js code step to your workflow and pasting this entire snippet in, and seeing if it works?

import { axios } from "@pipedream/platform";

export default defineComponent({
  props: {
    zoho_crm: {
      type: "app",
      app: "zoho_crm",
    },
    custom_module: {
      type: "string",
      label: "Custom Module",
      description: "Select a custom module to create an object",
      async options() {
        const response = await axios(this, {
          method: "GET",
          url: `https://www.zohoapis.com/crm/v2/settings/modules`,
          headers: {
            Authorization: `Zoho-oauthtoken ${this.zoho_crm.$auth.oauth_access_token}`,
          },
        });
        const customModules = response.modules.filter((module) => module.generated_type === "custom");
        return customModules.map((module) => {
          return { label: module.module_name, value: module.api_name };
        });
      },
    },
    object_data: {
      type: "object",
      label: "Object Data",
      description: "The data for the new object in the custom module",
    },
  },
  async run({ steps, $ }) {
    return await axios($, {
      method: "POST",
      url: `https://www.zohoapis.com/crm/v2/${this.custom_module}`,
      headers: {
        Authorization: `Zoho-oauthtoken ${this.zoho_crm.$auth.oauth_access_token}`,
      },
      data: this.object_data,
    });
  },
});

The Node script had issues passing the right token

But, we were able to get the existing step to work by just passing the name of the custom module through custom expression. The issue I had before was I was using the display name (which also had a space). It works using this method!

Had to lookup the API name in Zoho for Custom Module

Thanks for all your help Danny, the issue you raised would still be good improvement. Enumerating the custom modules in the pick list would save the steps I had to take

Glad you got it working! I agree that’s still a worthwhile update for us to make.