Function #28: Automatically calculate Customer Loyalty points

Function #28: Automatically calculate Customer Loyalty points

Hello everyone, and welcome back to our series! Today, we're excited to share a workflow designed to streamline the management of loyalty points. 

Many businesses offer incentives or rewards in the form of loyalty points to their customers as a way to promote recurring business and build customer loyalty. These points are typically earned by making purchases, which customers can accumulate over time and then redeem for various rewards, such as discounts, free products, credit points, gift cards, or other perks. 

Manually calculating the loyalty points for every customer's purchase can be a laborious and time-intensive process, particularly when you're managing a substantial customer base. But don't fret! Our custom function is here to save the day. The function will automatically calculate the loyalty points earned for each transaction and also generate a credit note once the specified limit is reached.

Here's how it works:

Whenever a customer makes a purchase and pays off the invoice in Zoho Books, the custom function gets executed. It calculates the loyalty points earned from that transaction and stores them in a custom field (created to accumulate the loyalty points). This process continues until the customer's loyalty point limit is reached. Then, the function automatically generates a credit note for the customer and resets their loyalty points. This credit note can be applied to the customer's next invoice, reducing the amount to be paid.



Prerequisites: 

1. Create a Connection named "zbooks" to successfully execute the function. You can watch the GIF attached below to learn how to create the connection.



2. Create a Number type custom field named "Loyalty points" for the Customers module. This field will store the points earned by a customer.




Custom Function:

Navigate to Settings -> Automation -> Custom Functions -> +New Custom Function > Add the function code from this GitHub link. Then, check and update the following variables as required.

1. minLoyaltyAmount - The purchase amount required for a customer to earn one loyalty point. For instance, if $500 spent equals 1 loyalty point, input 500 as the minLoyaltyAmount.
2. loyaltyFieldName - Copy and paste the API name of the custom field created in the Customers section to store loyalty points.
3. loyaltyLimit - Specify the limit to determine when loyalty points can be redeemed in the form of a credit note. For example, if a credit note should be generated when a customer accumulates 100 points, enter 100 as the loyaltyLimit.

Workflow Rule: 
 
Go to Settings -> Automation -> Workflow Rules -> +New Workflow Rule and set up the workflow rule as shown below:-






In the final step of this workflow rule, associate the custom function you created and then hit Save.

Should you require any help in customizing this function to better suit your requirements, don't hesitate to reach out to us at support[at]zohobooks[dot]com. We will be happy to assist you!

Regards,
Shireen Farhana 
Zoho Books

      • Recent Topics

      • Publish multiple languages at once in Knowledge Base

        Does anyone know if it is possible to publish multiple translated articles at the same time? My knowledge base has about 35 languages, and while I have them set up to automatically translate, I still have to go in and select each language and manually
      • Canvas and Related lists

        Hi, As much as I like canvas, when adding in a asection with related lists,it doesnt mimic the same functionality as the standard view within the CRM e.g left hand panel will show the module and total number of records. Is there a way of indicating this
      • Email address ZOHO suggestions in replying - how to delete unwanted suggestions?

        Hi, I have some "unwanted" email addresses suggestions by ZOHO, and made some mistakes by replying for some tickets already. How can I clear this in ZOHO directly, I deleted all web browser history and cookies . Did not help :/ Below example, where one
      • Copy Widget to another Dashboard

        I can see the option to clone a widget to the same dashboard but is it possible to copy it to another dashboard?
      • Subform edits don't appear in parent record timeline?

        Is it possible to have subform edits (like add row/delete row) appear in the Timeline for parent records? A user can edit a record, only edit the subform, and it doesn't appear in the timeline. Is there a workaround or way that we can show when a user
      • CRM x WorkDrive: File storage for new CRM signups is now powered by WorkDrive

        Availability Editions: All DCs: All Release plan: Released for new signups in all DCs. It will be enabled for existing users in a phased manner in the upcoming months. Help documentation: Documents in Zoho CRM Manage folders in Documents tab Manage files
      • Zoho Learn vs. Trainer Central

        Hi, I'm currently using Zoho One with a WordPress-based website and WooCommerce to manage my online courses. I would like to know what is the difference between Zoho Learn and Trainer Central and if it's possible for these two platforms to replace WP
      • How to Display a Logo Image on a Public Form?

        I would like to display a logo image in the header of a form. To achieve this, I added an Add Notes field to the form. The code below works perfectly for Zoho users accessing the form. However, when the form is made public, the image does not load properly:
      • Creating a Zoho Online Meeting in a Blueprint

        We are looking for an easy solution to schedule online meetings in a blueprint and ran into the same problem discussed in this topic: https://help.zoho.com/portal/en/community/topic/custom-function-to-set-meeting-to-online-meeting (After connecting Zoho
      • Enabling 'From Number' and 'To Number' fields in the Calls module

        Hello everyone, We've added "To Number" and "From Number" fields in the Calls module as part of our latest update to provide users with the option to enable or disable them through the Calls Preferences tab. When enabled, these fields will be displayed
      • Exciting Update: Multi WhatsApp Business Account (WABA) Support Now Available in SalesIQ!

        We’re pleased to share an important update that will enhance the way you manage your WhatsApp Business accounts (WABAs) within SalesIQ. With the launch of Multi WABA support, you can now connect and manage multiple brands more effectively, each under
      • Route Optimizer

        Does Zoho Inventory offer route optimization for our in-house deliveries? It will save us time to manually route our daily orders. Thank you
      • Can documents attached to different ZohoForms automatically go to different OneDrive folders?

        Hi there, I set a workflow to track and store applications coming in from our website. I created two different Zoho forms, one for unsolicited applications, one for applications to job postings. After any of the forms has been filled in, a new record
      • Kaizen #126 - Circuits in Zoho CRM - Part 1

        Hello everyone! Welcome back to another week of Kaizen! Today, we will discuss an exciting topic—Circuits in Zoho CRM. For starters, we will discuss what Circuits are, how beneficial they are for businesses, different views of a Circuit, and the different
      • Custom field doesn't fill when converting sales order to invoice

        Hi, When I convert a Sales Order to an Invoice one of the custom fields on a product line names "Subsidie" does not seem to fill in automatically. I manually have to select the product again by clicking on the product name in the order line en re-select
      • TeamInbox down?

        Hi everyone, we are getting message "Sorry, this action cannot be performed due to an internal error. Please try again later. We are on the Canadian data centers. Can someone please confirm if the service is down? Thank you! F
      • Purchase Requisition in Zoho Books

        I want to understand if Zoho Books is having the following workflow: PR ( Purchase Requisition ) >> PO ( Purchase order) >>  GRN/SRN ( Goods/Services receipt note) >> Bill
      • Confirmation prompt before a custom button action is triggered

        Have you ever created a custom button and just hoped that you/your users are prompted first to confirm the action? Well, Zoho knows this concept. For example, in blueprint, whenever we want to advance to the next state by clicking the transition, it is
      • Marketer's Space: Streamline marketing and sales by integrating ZMA's Planner with Zoho CRM

        In a competitive market, clear goal-setting and seamless campaign execution are crucial for marketing and sales alignment. When integrated with Zoho CRM, Zoho Marketing Automation's Planner enables marketers to create, manage, and measure campaigns effectively
      • Custom emails for Portals not working

        I changed the standard templates to custom email templates for all three options, but the invitation is still sending the original email layouts. Anyone know why this would be happening? I changed them 2 days ago.
      • Switching scheduled webinars from Live to On-demand

        Now that On-Demand webinars has been added as an option for webinar presenting, is there a way I can edit already scheduled webinars from Live to on-Demand? These scheduled webinars already have people registered. Thanks
      • Zoho CRM v2.1 deprecation or sunset plans ?

        Hi Team Wanted to know if there is any plan to deprecate v2.1 CRM apis https://www.zoho.com/crm/developer/docs/api/v2.1/ and if yes by when
      • Forex Bank Refund Entry

        Hello, please advise how to enter refunds from our bank forex department. The refund was because we were on preferential rates but at the time of USD purchase were not given the preferential rate, therefore the bank calculated the excess that we paid
      • Auto-Populating Custom Field

        This is to request a feature enhancement for our invoicing system. We're currently creating invoices with a single item per invoice and have a custom field called "Related Vehicle." We would like the "Related Vehicle" field to be automatically populated
      • How can i Customize Delivery Note?

        I need to customize delivery note like change the tittle for language purposes and also include only the balance due
      • Delivery note template

        We have some reasonable templates for sales docs but the delivery note one is very limited. It would be nice if we could have the same options as the sales form templates or even create our own by cloning an existing sales template, modifying (ie: removing
      • INTERCOMPANIES INVOICING

        Dears , I paid expenses on behalf of our sister company from my cash account , then month End i issued an invoice to the sister company , my question is how to put the expenses GL in the invoices
      • Zoho CRM Theme Color?

        I've read multiple articles stating it's possible to change Zoho CRM theme colour (top menu bar) from personal settings menu, however, my zoho has no options for this at all and I've looked everywhere........has this feature been removed? I'm currently
      • How can i force the user to select a project when creating an invoice ?

        Hello I tried all the ways that i know , but no way is able to stop creating an invoice without project.
      • Sales

        1/ How can I make a discount on invoice exmple : invoice 5,100 le , custmar pay 5000 and I need to make this 100 le as a discount , how can i make it ?! 2/ Is thare any report can make me match my company’s balance with the customer’s balance?
      • Include Project Hours when Creating Estimates from Projects

        Hi Currently, in Books, you can create estimates from Projects by inserting tasks that pull both the task and the hourly charge rate. But it doesn't pull the budgeted hours for the task, so you manually have to remember the number of hours for a given
      • acc

        Regularly sending statements to customers is an imperative part of many business processes as it helps foster strong customer relationships and provides timely guidance on pay//
      • South African Payment Gateways

        Since the "Demise" of Wave many South African users have moved over to Zoho and yet for years users have been requesting Integration with a South African Payment Gateway to no avail. Payfast was the most commonly requested gateway as it supports recurring
      • CRM Implementation

        I need to implement Zoho CRM. Is there a useful user manual available to guide me through the implementation?
      • Zoho Social integration with Zoho Flow

        Is there any plans for Zoho Social integration with Zoho Flow?
      • Marketing 2.0 has been a catastrophe

        Anyone else having significant issues with their link between their CRM and Marketing automation since moving to version 2.0? We had an easy flow for triggering leads in the CRM to journeys in Marketing Automation but now nothing seems to work properly.
      • Cannot average "Duration (Time)" from Pick List History Tracking in Reports

        Okay, let's say I have a custom module. In this custom module I have a pick-list named "Status" with "New", "In-Progress", "Completed" values. I also have turned ON pick-list history tracking and chose "Time" to track the duration in (instead of "Calendar
      • Customer Statement Template

        Hi. how can i add order number "customer LPO number" in the customer statement. regards
      • Authorize.Net Update: Disable Transaction IP Velocity Filter to Avoid Payment Failures

        Update: The Authorize.Net integration was updated on November 20, 2024. To prevent recurring transaction failures, we recommend disabling the Transaction IP Velocity Filter at the earliest. We’re updating the Authorize.Net integration in Zoho Books on
      • Need to send a single email to up to 20 recipients

        I want to send a single email to ~16 or 20 recipients. It appears that I cannot do this in Zoho email as it gets flagged as unusual activity. I need to be able to communicate with this group on a regular basis. What am I missing that Zoho doesn't allow
      • Next Page