Turn website enquiries into ServiceM8 clients and jobs

By General Input

Every enquiry from your website form becomes a ServiceM8 client and a job in your quoting queue, with a Slack ping so someone can call the lead back fast.

Integrations

  • Google Forms
  • ServiceM8
  • Slack

Type

Deterministic Code

Categories

  • Sales
  • Operations

Watch my website enquiry form in Google Forms and run this every time a new response lands, so no enquiry is lost between the website and the job board. Use a poll trigger for a new Google Forms response on my enquiry form. For each new response, read the full set of answers with Get Response so I have the raw question and answer pairs rather than just the response id.

From those answers, pull out the customer name, email address, phone number, the site address including the suburb, and the free text describing what they need done. Match the answers to my form questions by their question text rather than by position, so reordering the form does not break the mapping. Trim whitespace, and normalise the phone number to digits only for comparison purposes, dropping spaces, brackets, dashes and any leading country code, while keeping the original formatting for what gets saved.

Before creating anything, check whether this person is already a customer. Call ServiceM8 List Clients and look for an existing client whose email address matches the form email case insensitively, or whose phone number matches the normalised form phone. Compare against every phone field on the client record, not just the primary one. If exactly one client matches, reuse that client and do not create a new one, because a repeat customer must not end up duplicated on the client list. If nothing matches, call ServiceM8 Create Client with the customer name, email, phone and address from the form.

Important ServiceM8 API detail: creates return an empty response body, and the new record UUID comes back in the x-record-uuid response header. Read the new client UUID from that header, not from the body. Clients are created on company.json. If the header is missing, fail the run loudly rather than continuing with an empty client reference.

Work out where the job should sit by calling ServiceM8 List Job Queues and resolving my quoting queue by its name, so the queue UUID is looked up at run time instead of being hardcoded. Match the queue name case insensitively and ignore inactive queues. If the quoting queue cannot be found, still create the job so the lead is not lost, and say clearly in the Slack message that the job was created without a queue and needs to be moved manually.

Create the job with ServiceM8 Create Job. Link it to the client UUID from the previous step, set the job address to the site address from the form, and put the customer's enquiry text into the job description so whoever picks it up sees exactly what was asked for in the customer's own words. Place the job in the quoting queue UUID that was resolved. Read the new job UUID from the x-record-uuid response header, then call Get Job with that UUID to fetch the human readable job number, because the create call itself returns no body and the job number is generated server side.

Finish by posting to my new enquiries channel in Slack with Send a Message. The message should show the client name, the suburb, the enquiry text, and the new job number, and it should say whether this is a new client or an existing one so the person on the phones knows the history before they dial. Keep it short and scannable, since the whole point is that someone calls the lead back within the hour.

Process each new response exactly once, and never create the same job twice for the same form response if the workflow retries. If a response is missing both an email address and a phone number, skip the ServiceM8 client lookup, still create the client and job from whatever details were given, and flag in the Slack message that there are no contact details on the enquiry.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentWin back LiveChat visitors whose chats went unansweredChat quality review board for LiveChat support leadsWin back no-show and cancelled appointments every morningLive Loop returns analytics with product-level drill-downNewsletter pre-flight and approval board for Mailjet sendsTurn a prospect spreadsheet into personalized sequence enrollmentsMailjet email delivery lookup console for support teamsCatch feature flags that never got switched on in productionKajabi customer support console for member access fixes