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

      • Triggering rules on lead conversion

        There is no field on the Rule list for rule conversion to trigger an alert on liead conversion to a potential. I assigned a rule to file on any creation or update of a lead. The lead was changed a lead to a potential but no rule was fired. Rajesh Bhadra
      • How do you remove a user from SalesIQ?

        I have a user in Sales IQ who needs to be removed (she's no longer involved with sales and chat) but I can't find any way to remove her. How do I do that?
      • Integrate SalesIQ with tiendanube.com

        Tiendanube.com is the leading e-commerce platform designed to help businesses create and manage online stores. It provides tools for entrepreneurs and companies to set up, customize, and operate their online shops with ease. Tiendanube is particularly
      • How to reset Zoho Commerce

        Hi, we are preparing a new onlineshop connected to commerce and books for going live in the next days. Now we want to delete all tests and transactions we made within the development process. And also add a new tax rule which is not possible at the moment
      • Free webinar: ‌Zoho Vault in 2024—A live Q&A with our experts

        Hi everyone! 2024 has been a pivotal year for us, taking our journey from a basic team password manager in 2013 to a full-featured security platform offering password management, single sign-on (SSO), and soon, passkey management. Our team has been tirelessly
      • Kaizen #167 - Configuration and Initialization of Zoho CRM Python SDK (V7) for different client types

        Hello everyone! Welcome back to another week of Kaizen! Zoho CRM Python SDK allows developers to integrate Python applications with Zoho CRM. In today's Kaizen post, we will explore how to initialize and configure the SDK for both self-clients and server-based
      • Zoho Forms - Dynamic Prefill Setup Question

        Hello, I'm very excited about this feature. So much I'm learning about webhooks. However, it seems that the webhooks I can obtain from Zoho Flow and Zoho CRM come with already parts in the URL that are put as invalid by the GET Webhook URL. Do I need
      • How to get a list of Team Folders associated to a Project from the API?

        I've tried the below, based on another article and was unsuccessful. response = invokeurl [ url :"https://projectsapi.zoho.com/api/v3/portal/" + _portalID + "/projects/" + _projectResID + "/folders" type :GET connection:"zohoprojects" ]; info response;
      • Email Alert attachments unavailable for Vendor Payments

        I have several vendors with country specific compliance requirements to support the payment of their invoices. I've created Vendor Payment templates to meet their requirements and I setup an automation workflow that gets triggered when the invoice is
      • How to create Sepa Direct Debit XML file: solution and code

        Even though Books provides a payment integration for Stripe and Gocardless (in Europe) there are customers that want to use the Sepa services of their own bank. Mainly because Stripe and Gocardless are quite expensive. In that case they would need a Sepa
      • Exporting Project Tasks

        I can export the gantt chart to a nice PDF in colour, but we want just the task list in a nice colour layout. Is there a way to export it to PDF without the gantt? It would be perfect to give to clients.
      • bug reporting with the count of linked Desk tickets

        I am aware that when viewing an individual bug, you are able to see a count of the Desk tickets that are linked to the bug on the right hand side. However, I cannot see a way of reporting this figure from a list of bugs. Our use case is that we would
      • Unable to send e-mails to an specific address

        Hello. I'm having problems sending e-mails to my shipping company. user@shippingcompanydomain.com INVALID_ADDRESS, ERROR_CODE :550, ERROR_CODE :5.1.1 <user@shippingcompanydomain.com>: Recipient address rejected: User unknown in virtual mailbox table Reporting-MTA:
      • Emails linked to Deal

        Hello everyone, I’d like to ask a question to see if someone can help me out. We are requesting availability from suppliers by sending emails directly from the Opportunity. These emails we send are logged within the Opportunity; however, when we receive
      • Blueprint transition help needed

        I have 5 approvers. For a stage to be passed to the next stage, I require any 3 out of these 5 approvers to make the approval. There is no particular sequence of approval, at any one time, any one can approve. As long as 3 approvers approve, the stage
      • Year-End Wrap: Out-of-Office Made Easy with Zoho Mail

        As we wrap up 2024, now is the perfect moment to take control of your email routine and gear up yourself for a productive and successful new year. We have curated a series of weekly tips to help you master your email management starting today. Watch out
      • Creator Simplified #9: Automatically Sending Uploaded Files as Email Attachments

        Hey Creators, Welcome back to the Creator Simplified series! Today, we’ll explore how to automate file uploads as email attachments in Zoho Creator a handy feature that saves time and reduces manual effort in your business process. Use Case: In a typical
      • Zoho Books Community Meetup: Learn, Grow, Network!

        Hello users! We are excited to announce a series of upcoming Zoho User Group meetups and would love for you to join us! This is a great opportunity for you to connect with other users, share experiences, and learn more about how to make the most of our
      • Bar chart from Deal Stage Snapshot table not showing right amounts

        Hi, since we needed to track the changes of our deal pipeline over time, I added a new data source and selected 'Snapshots' to start the sync. At first I thought it was working just fine, after a few days I realized that something was wrong with the amounts
      • How to Display Territory Field on Deal Object

        I am assigning Territories to Deals. I am able to use the Territory field as a column in my list view but cannot figure out how to enable it to be visible when viewing a Deal record directly. Can you advise on how to display the territory assignment as
      • Power of Automation::Automate the process of creating Tasks from Task template on project status update.

        Hello Everyone, Here we are again to share another requirement that has been accomplished through the implementation of custom functions. A Custom function is a user-written set of code to achieve a specific requirement. Set the required conditions needed
      • Im Stuck in an EDIT ONLY WITH WIZARD issue

        So I found Wizards to be a really helpful tool in minimizing the exposure of redundant, superfluous fields to staff that would never otherwise have to edit those fields. My issue is, that when the record (in this case a lead) is created with a wizard,
      • Mass Update in Zoho CRM

        Hello, I want to update my past update records by using deluge on some conditions. anyone can please tell me how can I do it.
      • LinkedIn Followers not correct

        It looks like Zoho Analytics only counts followers from the day it was connected to our LinkedIn-page. The Total Followers Count in Analytics only displays 549 followers, while in reality we have 1,036 followers. The information is correct in Zoho Social,
      • [API] How to get Contact's funnel?

        Hi everyone! I am trying to use the API to get a Contact funnel's (step, name.. anything). Can anyone help me? This information is not available in the API response... I need to retrieve and change my Contacts between funnels dynamically according to
      • Task created from Email Alias

        When forwarding multiple emails to project email alias, it will create a task as internal which makes a lot of "General" Task List as I've created automation to set the flag as external. Is there any way to set up the task list created from email alias
      • Automation#24: Auto-Update custom field from Accounts to Tickets

        Hello Everyone! Welcome back to the Community Learning Series! This episode dives into how Zylker Techfix streamlines account-related ticket references. Previously, employees had to manually check account details to retrieve specific customer information,
      • How do I add an email to tasks in Trident?

        Hi, I'm trialling Trident to see if it works better for me than the browser version. It's a nice idea and looks quite refined, so I'd like to be able to use it. My first question is: how can I add and email to a task? I can't find any obvious way, but
      • Project template after project creation

        How can I apply a project template AFTER the project has been created?
      • Creating Email template that attaches file uploaded in specific field.

        If there's a way to do this using Zoho CRM's built-in features, then this has eluded me! I'm looking to create a workflow that automatically sends an email upon execution, and that email includes an attachment uploaded in a specific field. Email templates
      • How to create a Field with answers as Yes, No> Further if no is selected a new field to be visible to give details

        Dear All, I am creating a feedback form in HR Letter. The question is were you satisfied with the work allotted. Expected answer to this is Yes, No. Further if the response is no, then a field to be give to fill more details as to why no was selected.
      • Filter Tabs in a Dashboard

        I have multiple tabs in a dashboard one of which is aimed at a different audience, is it possible to filter out this tab for a group of users?
      • How do I set up Contact Scoring for my existing contacts

        I'm trying to set up Contact Scoring for my subscribers, 9 months after creating the database. I've added the Campaign Activities, but none of the contacts have a score. How can I update all the contacts so they show a score? My goal is to ultimately
      • ZOHO PEOPLE

        HOW CAN I DELETE LEAVE HISTORIES IN ZOHO PEOPLE?
      • Kiosk Studio: Function FIX for Date/Time Field (Keep getting wrong format error)

        I am using the foillowing function in my Kiosk Studio to update the previously entered Date/Time field from previous screen to update that to the same date/time field in Lead Record. Every time I 'Save & Execute' I get a Success but with 'Date/time Format
      • Zoho CRM Web To Lead Form: Radio Buttons/Pulll Down Menus?

        Hi is there a way to set up radio buttons, check boxes or pull down menus in the web to lead form? We often ask additional lead qualifiers or demographics information and in some cases radio buttons or pull down menus are necessary or more efficient to
      • 5名限定 課題解決型ワークショップイベント Zoho ワークアウト開催のお知らせ (10/31)

        ユーザーの皆さま、こんにちは。Zoho ユーザーコミュニティチームの藤澤です。 10月開催のZoho ワークアウトについてお知らせします。 ━━━━━━━━━━━━━━━━━━━━━━━━ Zoho ワークアウトとは? Zoho ユーザー同士で交流しながら、サービスに関する疑問や不明点の解消を目的とした「Zoho ワークアウト」を開催します。 Zoho サービスで完了させたい設定やカスタマイズ、環境の整備など……各自で決めた目標達成に向け、 他の参加者と同じ空間で作業を行うイベントです。先輩ユーザーや他の参加者と意見交換をしながら集中して作業に取り組むことが可能です。
      • Is Drawing feature supported in zoho Sheets?

        Is there any option to draw arrows and some basic shapes such as circle , rectangle etc in zoho sheets? if so, can someone help me find it 
      • Zoho Meetings - Scheduling sucks

        I wanted to try this out for our little meeting group. I scheduled the meetings for Tuesdays, Thursdays and Fridays. No matter what I did, the meetings all showed on FRIDAY. I changed the date and hit save. Still friday. Terrible system. Back to Zoo
      • This user is not allowed to add in Zoho. Please contact support-as@zohocorp.com for further details

        Hello, Just signed up to ZOHO on a friend's recommendation. Got the TXT part (verified my domain), but whenever I try to add ANY user, I get the error: This user is not allowed to add in Zoho. Please contact support-as@zohocorp.com for further details I have emailed as well and writing here as well because when I searched, I saw many people faced the same issue and instead of email, they got a faster response here. My domain is: raisingreaderspk . com Hope this can be resolved.  Thank you
      • Next Page