Zoho Flow Custom Function Issue

Zoho Flow Custom Function Issue

I have a use case where I will be needing to post data to a wordpress site.  Specifically to a custom post type with a bunch of ACF fields.

I have setup trigger event correctly for Tookan and can receive data from the webhook.

 

In order to post the data to the site I am needing to use a custom function.

I setup the function as a map with parameters passed in as string values for all the values returned from the Tookan webhook.

 

Here is my current code:

 

map Tookan_ReportAutomation(

string tracking_link,

string total_time_spent_at_task_till_completion,

string job_address,

string total_distance,

string order_id,

string customer_id,

string customer_email,

string acknowledged_datetime,

string arrived_datetime,

string started_datetime,

string completed_datetime,

string job_time,string timezone,

string fleet_name,

string fleet_email,

string fleet_phone,

string fleet_id,

string CAR_DETAILS,

string SERVICE_DETAILS,

string LABOUR_CHARGED,

string MECHANIC_EARNINGS,

string CAR_LICENSE_DISC,

string MILEAGE,

string DASH,

string WARNING_LIGHTS,

string DIAGNOSTIC_MACHINE_OUTPUT,

string BRAKES_TYRES,

string FRONT_BRAKE_PADS,

string REAR_BRAKE_PADS_SHOES,

string FRONT_DISCS,

string REAR_DISCS,

string BRAKE_CALIPERS,

string FRONT_TYRES,

string REAR_TYRES,

string SPARE_TYRES,

string JACK_TOOLS,

string FLUIDS,

string ENGINE_OIL,

string TRANSMISSION_OIL,

string BRAKE_FLUID,

string COOLANT,

string ENGINE_BATTERY,

string ENGINE_OIL_LEAKS,

string TRANSMISSION_OIL_LEAKS,

string OTHER_LEAKS,

string DRIVE_BELT_CONDITION,

string FAN_WORKING,

string SPARK_GLOW_PLUGS,

string BATTERY_CORROSION,

string BATTERY_CASE_LEAKS,

string BATTERY_LOAD_TEST,

string BATTERY_VOLTAGE,

string LIGHTS,

string INDICATOR_LIGHTS,

string REVERSE_LIGHTS,

string HEADLIGHTS,

string OTHER_LIGHTS,

string SUSPENSION,

string SHOCKS_STRUT_CONDITION,

string BALL_JOINTS,

string CV_JOINT_AXLE,

string WHEEL_BEARINGS,

string WINDSHIELD_WINDOWS,

string WINDSHIELD_WINDOW_CONDITION,

string WINDSHIELD_WIPERS_OPERATIONAL,

string WINDSHIELD_WIPER_BLADE_CONDITION,

string WASHER_SYSTEM,

string AC,

string AC_BELT_CONDITION,

string AC_AIRFLOW,

string DOORS_MIRRORS,

string DOOR_CONDITION,

string MIRROR_CONDITION,

string TEST_DRIVE,

string STARTER_OPERATIONAL,

string SPEEDOMETER_OPERATIONAL,

string ENGINE_SOUNDS_NORMAL,

string GEARS_CHANGE_SMOOTHLY,

string BRAKES_SOLID_FIRM,

string STEERING_VIBRATES_WHEN_BRAKES_APPLIED,

string SUSPENSION_IS_SMOOTH,

string INDICATOR_CANCELS_AUTOMATICALLY,

string HANDBRAKE_HOLDS_FIRM,

string HANDBRAKE_LIGHT_ON_WHEN_SET,

string OTHER,

string SEATBELTS,

string HOOTER,

string REMOTE_KEYS,

string DOOR_LOCKS,

string ANTENNA,

string EXHAUST_SYSTEM_CONDITION,

string FEEDBACK_ON_ISSUES,

string PARTS_REQUIRED

){

 

                // Define your authentication credentials using Map()

    const authCredentials = Map();

    authCredentials.put("username", “my-email”);

    authCredentials.put("password", "my-password");

 

    // Step 1: Authenticate and get the token

    const authResponse = postUrl(https://my-domain/wp-json/jwt-auth/v1/token, authCredentials);

 

    const authToken = authResponse.token; // Assuming your response structure provides the token

 

    // Step 2: Construct the post data

    const postData = Map();

    postData.put("title", "New Report Title"); // Use a relevant title

    postData.put("content", "Report content goes here."); // Use relevant content

    postData.put("status", "publish");

 

    // Define fields using Map() for ACF values

    const fields = Map();

    fields.put("field_1", CAR_DETAILS);

    fields.put("field_2", DASH);

    // ... (other ACF fields)

    postData.put("fields", fields);

 

                const headers = Map();

                headers.put("Content-Type", "application/json");

                headers.put("Authorization", "Bearer " + authToken); // Include the token in the headers

 

    // Step 3: Make the POST request and capture the response

    const response = postUrl(https://my-domain/wp-json/wp/v2/posts, postData, headers,false);

 

    // Return the API response

    return response;

}

 

I keep getting a syntax error though: Syntax error. Expecting 'throws','sendmail','sendsms','break',function call statement,executeshellscript statement,'pushnotification',assignment statement ,'try','if','for',invokeurl statement,'return',invokeintegration statement,'continue' or 'cancel'. Found 'authCredentials'. at line number 97. Resolve the errors and try again


The same approach in a function in Zoho CRM works just fine and I can post to api endpoints but not from my custom function in Zoho Flow.

 

What am I missing?  Any help would be super appreciated!


    • Recent Topics

    • How do the keyword critera work?

      Hi, I'm working on automated assignment of tickets based on keywords. How does this feature work? Where does this criteria look for keywords - email address, subject, email body? Can you please clarify this as I want to avoid overlapping with criteria
    • Error: Unsupported content type: text/html;charset=UTF-8 after tryeing to get the token for n8n automation

      I am working on ZOHO Desk automation and need to get the ZOHO auth token for n8n I have created the app in ZOHO Desk API, got client id and client secret. Added all data required to get a token in n8n. After I sign in with my ZOHO credentials in ZOHO
    • Improving Collaboration Features in Zoho Portal

      Hello Zoho Community, I’ve recently started exploring Zoho services and I’m really impressed with the wide range of features. However, I feel there is still room for improvement in the collaboration area. For example, it would be really helpful if we
    • Automated Shopify Emails Not Being Delivered

      I have an ecommerce store with Shopify. I recently set up my email to be served through Zoho. Since doing this, customers are not receiving some of our automated emails from Shopify itself. Our initial email that confirms their purchase goes through but our Shipping Notification that is automatically sent out upon fulfillment is not going through. Sometimes we get a notice that it's been classified as spam, sometimes nothing. I can send/receive email via Outlook on my desktop and I can send/receive
    • Clear Tag & Linking Between Quotes and Sales Orders

      Hi Zoho Team, In Zoho Books, when a quote is converted into a sales order, it would be extremely useful to have: A clear tag/indicator on the quote showing that it has been converted into a sales order. A direct link in the sales order back to the originating
    • I can't log in to my account on Thunderbird

      I've just had to rebuild my PC (calamitous mess from Microsoft with Win10/Win 11 'upgrade' - they confirmed I had to start with a new build). I have used Zoho mail for years via Mozilla Thunderbird, but now I've had to download the latest version of TBird,
    • New in Cadences: Option to Resume or Restart follow-ups when re-enrolling records into a Cadence, and specify custom un-enrollment criteria

      Managing follow-ups effectively involves understanding the appropriate timing for reaching out, as well as knowing when to take a break and resume later, or deciding if it's necessary to start the follow-up process anew. With two significant enhancements
    • Send a campaign to one recipient.

      Very often I speak to a customer and they say they didn't see my email (maybe it went in Junk, maybe they deleted it). Anyway, I just want to go into the Campaign and send it to one person. You already have a feature very close to this - when sending a Test. While developing a campaign, I can send tests to anyone. Why can't we have this AFTER  the campaign has been sent? I know, there's a caveat, and that's in the use of merge tags. Most of the time I only use FNAME, but maybe you could check if
    • Try FSM again for our business

      We already have our customers individual equipment in CRM with serial numbers, install dates, warranty length and importantly next service which is generally 2 years. a month before the service date is due we get get a report and send out service reminders.
    • Use Zoho Books to bill for work done in Zoho Desk??

      I'm trying to see if something is possible (and if yes, how). We use Zoho One to manage our business. We have a lot of clients that will put in a ticket (via portal) to have work done. Out techs will pick up the ticket, do the work, and then log the time
    • Get Cliq Meetings in my O365 calendar

      Hi, we are currently evaluating to replace the Teams Messaging and Meetings with Cliq. We currently still have all our email and calendars in O365. What i want to achieve is, to create a (ZOHO) meeting from Cliq and have this meeting added to my Outlook/O365
    • Issue with Zoho Help Portal – Tickets Missing or Not Answered

      Hi, How are you? I think there may be an issue with the Zoho Help Portal. I opened a few tickets directly in the help portal a some time ago but never received any response I also opened ticket 148356451 by email. I did receive a reply to it, but the
    • No bank feeds from First National Bank South Africa since 12 September

      I do not know how Zoho Books expects its customers to run a business like this. I have contacted Zoho books numerous times about this and the say it is solved - on email NO ONE ANSWERS THE SOUTH AFRICAN HELP LINE Come on Zoho Books, you cannot expect
    • Changing the Default Search Criteria for Finding Duplicates

      Hey everyone, is it possible to adjust the default search criteria for finding and merging duplicate records? Right now, CRM uses some (in my opinion nonsensical) fields as search criteria for duplicate records which do nothing except dilute the results.
    • DUNS & Bradstreet and Credit risk monitoring integration with Zoho books

      Small businesses not being paid by bigger clients and clients of all sizes is a huge problem. It will be nice if Zoho develops integration with DUNS & Bradstreet(D&B) and Credit risk monitoring integration with Zoho books. That have small businesses can
    • Zoho Forms - Form Rules based on attachment fields

      Many businesses use forms to collect documents and images from customers. In many cases, you may want to trigger a notification or other automation based on whether or not an attachment was added. I've noticed that attachment fields do not appear in Rules
    • How can I sync from Zoho Projects into an existing Zoho Sprints project?

      Hi I have managed to integrate Zoho Projects with Zoho Sprints and I can see that the integration works as a project was created in Zoho Sprints. But, what I would like to do is to sync into an existing Zoho Sprints project. Is there a way to make that
    • How to sync from Zoho Projects into an existing Sprint in Zoho Sprints?

      Hi I have managed to integrate Zoho Projects with Zoho Sprints and I can see that the integration works as a project was created in Zoho Sprints. But, what I would like to do is to sync into an existing Zoho Sprints project. Is there a way to make that
    • Add multiple users to a task

      When I´m assigning a task it is almost always related to more than one person. Practical situation: When a client request some improvement the related department opens the task with the situation and people related to it as the client itself, the salesman
    • Add QUOTE OWNER profile image to a Quote Template

      I can add their email address.. phone number, DOB. I need to add a users profile picture so when they assign a template to a quote they own it adds their picture to the cover page. I've tried hacking a solution together but there has to be an easier way.
    • Can't open draft email for editing

      Last night I started composing an email and I let it save in drafts. This morning I want to continue working on the email. It is in my Drafts folder but it will not open. The only option there is to delete it. This is not the first time it has happened. On previous occasions I have just deleted the draft and started afresh, but I really want this one back. Windows 10 with Pale Moon 28.10.0 browser.
    • Failing to generate Access and Refresh Token

      Hello.  I have two problems: First one when generating Access and Refresh Token I get this response:  As per the guide here : https://www.zoho.com/books/api/v3/#oauth (using server based application) I'm following all the steps. I have managed to get
    • Email Integration - Zoho CRM - OAuth and IMAP

      Hello, We are attempting to integrate our Microsoft 365 email with Zoho CRM. We are using the documentation at Email Configuration for IMAP and POP3 (zoho.com) We use Microsoft 365 and per their recommendations (and requirements) for secure email we have
    • No Response from Zoho Support in 8 Days - Typical?

      I have a couple of issues I'm trying to work through. Initially, I was getting support from support@zohofsm.com, but I have not received a response in 8 days (11 on another question). Is this typical? Can I pay for support? For context, I am not spamming
    • Open filtered deals from campaign

      Do you think a feature like this would be feasible? Say you are seeing campaign "XYZ" in CRM. The campaign has a related list of deals. If you want to see the related deals in a deal view, you should navigate to the Deals module, open the campaign filter,
    • Change scheduling emails time

      When sending an individual email there is a great feature to schedule them to send later. I could only use the one time that is suggested. Is there a way to select another time? Regards, Glenn
    • Zoho CRM: how can I control which contacts to sync with Outlook?

      I was just playing around syncing contacts from Zoho to MS Outlook (MS365 account.) The problem is our firm has hundreds of thousands of contacts and I don't want to bury my contacts list in outlook. Any help with this is greatly appreciated.
    • How to overcome limitations in meetings

      As a company, one of our deliverables is a meeting between two other companies, where we act as facilitators. So, if we recorded this meeting  in Zoho CRM, it should be connected to 2 accounts, 2 contacts, and 1 campaign (a campaign, in our use, is the
    • Different MRP / Pricing for same product but different batches

      We often face the following situations where MRP of a particular product changes on every purchase and hence we have to charge the customer accordingly. This can't be solved by Batch tracking as of now so far as I understand Zoho. How do you manage it as of now? 
    • Add a 'Log a Call' link to three dot icon in Canvas

      Hi, There's a three dot element when creating a canvas called 'More'. I would like to modify this to add a link that says 'Log a Call' in order to quickly record the details of a cellphone call. I'd also like this to be a simple 'contact' selection and
    • Syncing Zoho Forms with Bigin - Embedding issue?

      Hello everyone, I created a Zoho Form for a page on my GoDaddy website to collect leads, which then transfers the data to Bigin. However, I'm facing an issue where it doesn't seem to work properly. I've integrated Zoho Forms with Bigin and tried embedding
    • Can not add fields to a Section

      I feel like I'm missing something obvious: I can add new Sections to my form but I can not add fields to the Sections. I've tried fields already on the form as well as dragging and dropping new fields into the Section but nothing will go into it. What
    • Record Logged in User while using CRM lookup field

      Is it possible, while using the Zoho CRM lookup field, to automatically use the user account logged into Zoho CRM in a hidden field? I was hoping to add employee accounts to my current plan. But would like a record on the Form submission of who submitted
    • Form Rules for Suburb Categories to alternate landing pages or Making a Fields Contents ALL CAPS

      I need to send differentform submissions to two to three different thank-you URLs (for Meta/Google pixels) depending on which suburb a user selects in a form. I have ~400 suburbs split into two categories (A and B, based on business value). Current challenges:
    • Collaps Notes

      There are times when long/large notes are added to a record i.e. Accounts or Deals etc. Currently, the full note is displayed in the notes related list section. It would be great if by default only 5 to 10 rows of the note are displayed when the note
    • Zoho Down

      I have a drop in my Zoho One services.
    • Runing RPA Agents on Headless Windows 11 Machines

      Has anyone tried this? Anything to be aware of regarding screen resolution?
    • Problem for EU users connecting Zoho CRM through Google Ads for Enhanced conversions

      Has anyone else experienced this problem when trying to connect Zoho CRM through Google Ads interface to setup enhanced conversions? Did you guys get it fixed somehow? The Problem: The current Google Ads integration is hardcoded to use Zoho's US authentication
    • Why am I getting event Pop-up Notification for events that have been cancelled?

      Why is Calendar Notification still popping up for events that have been cancelled or changed? Each time events are cancelled or changed, I have observed that I am still getting notifications for them. Below is a sample pop-up notification for one of the
    • Whatsapp Limitation Questions

      Good day, I would like to find out about the functionality or possibility of all the below points within the Zoho/WhatsApp integration. Will WhatsApp buttons ever be possible in the future? Will WhatsApp Re-directs to different users be possible based
    • Next Page