Kaizen 127 - Circuits in Zoho CRM - Part 2

Kaizen 127 - Circuits in Zoho CRM - Part 2

Hello everyone!

We're back with part 2 of Circuits in Zoho CRM!
We are as excited as you are with this topic! Let's dive right in!

As promised, in today's post, we will discuss a use case, see how execution happens, and associate that circuit with a workflow.

In our next post(Yes! There's going to be another one!), we will associate the circuit with a button and a blueprint, view logs, and debug issues.

Sample use case - Loan Verification Process

Consider that we have a module in CRM called Customers, where we have personal information of customers, tax-related details, tax and personal ID verification details and status. Our aim is to check the requested loan amount, check eligibility, and then grant or reject it.
Here is a screenshot of a record in the Customers module.


Our condition is that whenever the loan amount is less than Rs. 500,000, the circuit should directly proceed to document verification. When the requested loan amount is greater than Rs. 500,000, we must check a few eligibility criteria before proceeding to document verification.
We can automate this entire process using Circuits, and execute it through a button, associate it with a workflow or a blueprint.

Let's take a look at the Circuit's flow.














Here are the different states of the Circuit that explain the logic.
  1. Get the loan record.
  2. Check the loan amount.
  3. If the loan amount is less than Rs. 500,000, proceed to document verification.
  4. If the loan amount is greater than Rs. 500,000, check the tax filing status.
  5. If tax is not filed, update the record's Loan Eligibility field with the value "Tax not filed. Hence, not eligible for loan".
  6. If tax is filed, fetch the applicant's credit score and check the eligibility.
  7. If the credit score falls short, update the record's Loan Eligibility field with the value "Issue with credit score".
  8. If the credit score is up to the mark, proceed to document verification—Personal ID and Tax ID verification.
  9. Update the details of the record to sanction the requested loan.

Let's discuss each of these states in detail.

1. Get the loan record

Builder View



Type: Get Record from Zoho CRM's states.
Action: Gets the details of the loan record from the Customers module. The output is in the following format.

{
    "ZohoCRM": {
        "record_id": "5575270000005762031",
        "user_id": "5575270000005379053",
        "module": {
            "api_name": "Customers",
            "tab_label": "Customers",
            "id": "5575270000001975002"
        }
    },
    "record": {
        "data": [
            {
                "Owner": {
                    "name": "Patricia Boyle",
                    "id": "5575270000001947001",
                    "email": "p.boyle@zylker.com"
                },
                "$currency_symbol": "$",
                "Tax_ID_Verification_Message": "Tax ID Verified Successfully",
                "$review_process": {
                    "approve": false,
                    "reject": false,
                    "resubmit": false
                },
                "$sharing_permission": "full_access",
                "Personal_ID_Number": "464694660655",
                "Personal_ID_Verification_Message": "Personal ID Verified Successfully",
                "Name": "Stephen Adams",
                "Manual_Approval": "Depends on score",
                "$state": "save",
                "$process_flow": false,
                "Tax_Score_Status": "Score is eligible for Loan",
                "$locked_for_me": false,
                "Tax_ID_Number": "GBHPS3618H",
                "id": "5575270000005762031",
                "Tax_ID_Verified_Date": "2024-02-26",
                "Loan_Eligibility": "Eligible for Loan",
                "$approval": {
                    "delegate": false,
                    "approve": false,
                    "reject": false,
                    "resubmit": false
                },
                "Modified_Time": "2024-02-29T12:26:11+05:30",
                "Tax_ID_Verification_Status": "Verified",
                "Tax_Return_Availability": "Yes",
                "Tax_ID_Verified_Time": "2024-02-26 23:28:39.0",
                "Personal_ID_Verified_Time": "2024-02-26 23:28:39.0",
                "Created_Time": "2024-02-29T12:26:11+05:30",
                "Amount": 600000,
                "$editable": true,
                "Personal_ID_Reference": "6cefa3d4-b87b-46a6-8814-b21fb422a28d",
                "$orchestration": false,
                "Tax_ID_Reference": "f6697aa8-8efc-4ee9-8dcc-0bc838755cb4",
                "Tax_Score": 450,
                "Personal_ID_Verification_Status": "Verified",
                "Personal_ID_Verified_Date": "2024-02-26",
                "$in_merge": false,
                "Locked__s": false,
                "Tag": [],
                "$zia_owner_assignment": "owner_recommendation_unavailable",
                "$approval_state": "approved",
                "$pathfinder": false
            }
        ]
    }
}

You can use any part of this output as input to other states. You can achieve this by using the JSON Path expression in the “result path” to traverse the result JSON of the state.
Result path allows you to combine state result with state input to pass as output. You can add the result path in the "Input/Output" section in the Builder view as well as the JSON in Code view.



In our case, we want to use the data inside the “record” JSON object. So, the result path will be $.record.
Result path is mandatory when you use the Get Record Zoho CRM state.
Next state: Check Loan Amount

Code View



2. Check Loan Amount

Builder View



Type: Branch
Action: Checks for the condition specified in the branch—check if the loan amount < 500,000. If yes, and Go to Documents verification state, else go to Check tax filing status state.
Next state: Check Tax filing status(if loan amount > 500,000)

Code View



3. Check Tax Filing Status

Builder View



Type: Branch
Action: Checks for the condition specified in the branch—if the tax filing status is Yes, fetch the credit score. Else, update the record with "Tax not filed; not eligible for loan".
Next state: Fetch Applicant Credit Score

4. Fetch Applicant Credit Score

Builder View



Type: Function
Action: Executes the CRM function "Tax Score Check" that holds the logic to get the basic eligibility stored in the Org variable "eligibility", compare it with the tax score of the applicant, and update the record, accordingly. Here is the snippet of this function.

Next state: Check eligibility of Credit Score

Code View


5. Check eligibility of Credit Score

Builder View



Type: Branch
Action: Checks for multiple conditions—if Tax Score Status = Eligible, go to Document Verification.
If Tax Score Status = Not eligible & the value of the field "Manual Approval" = "Not approved", update the record with "Issue in Tax Score".
If Tax Score Status = Not Eligible & "Manual Approval" = "Approved", proceed to document verification.
Next state: Depends on the condition that is met in the "Check Tax Score Eligibility" state.

Code View


6. Documents Verification Process

Builder View



Type: Parallel
Action: Verifies the Tax ID and Personal ID of the applicant.
Next state: Verification Details - Update Record

Code View


7. Tax ID Verification

Builder View


Type: Function
Action: Executes the function "Tax ID Verification" that has the logic to verify the tax details of the applicant.
Here is the snippet of this function.

Next state: Verification Details - Update Record

Code View


8. Personal ID Verification

Builder View


Type: Function
Action: Executes the function "Personal ID Verification" that has the logic to check for the applicant's personal details.
Here is how the function looks.

Next state: Verification Details - Update Record

Code View



9. Verification Details - Update Record

Builder View


Type: Function
Action: Executes the function "Update Customer Record status" that uses the Deluge Update Record integration task to update the "Loan eligibility" field.
Here is how the function looks.

Next state: End

Code View


10. Update Record - Tax Not Filed, Not Eligible

Builder View


Input/Output


Type: Function
Action: When the requested loan is greater than Rs.500,000 and the Tax Filing Status in "Not Filed", this state executes the function "Update Customer Record status". This function uses the Deluge Update Record integration task to update the "Loan eligibility" field, and takes the parameters "rec_id" and "loan_eligibility" with the values "$.ZohoCRM.record_id" and "Tax Filing is missing, Hence not eligible for the loan.", respectively.
Next state: End

Code View


11. Update Record - Issue with Credit Score

Builder View


Type: Pass
Action: When the tax score eligibility does not meet the requirement, this state ends the circuit's execution.
Next state: End

Code View



Testing and Execution

Let us see the execution of this circuit with a sample record ID.


When you click each state, you can see the input and output of that state.
When you click "View Logs", you can see how execution has happened, the payload for each state, the response, etc.


Associating this Circuit with a Workflow

Follow the steps mentioned in this article to create a workflow.
The condition for this workflow to execute the circuit is when the requested loan is greater than Rs. 500,000.
The Action is to execute the circuit. Choose the option "Execute Circuit" from the Instant Actions and select the Verification Process Circuit.
Save the workflow.


Let's test this workflow by creating a record in the Customers module with the loan amount less than Rs. 500,000.


As you can see, the workflow is triggered and executes the circuit when the loan amount is less than Rs. 500,000.
You can view the circuit's execution and other details as a related list.

Summary

Circuits allow you to automate entire business processes by allowing you to orchestrate functions along with your business logic as you see fit.
As you witnessed in this example, we used multiple independent functions written in CRM to achieve our business case through utilizing them in a circuit. This gives you the benefit of writing functions that can be reused in multiple places while saving you from the grief of dealing with huge volumes of code that are hard to maintain and harder to debug when written as a single function.

We hope you liked this post. We'll see you next week with another post on Circuits.
Let us know if you have any questions or feedback. We are listening!

Cheers!
Shylaja S

Additional Reading:

    Access your files securely from anywhere


            Zoho Developer Community




                                      Zoho Desk Resources

                                      • Desk Community Learning Series


                                      • Digest


                                      • Functions


                                      • Meetups


                                      • Kbase


                                      • Resources


                                      • Glossary


                                      • Desk Marketplace


                                      • MVP Corner


                                      • Word of the Day



                                          Zoho Marketing Automation


                                                  Manage your brands on social media



                                                        Zoho TeamInbox Resources

                                                          Zoho DataPrep Resources



                                                            Zoho CRM Plus Resources

                                                              Zoho Books Resources


                                                                Zoho Subscriptions Resources

                                                                  Zoho Projects Resources


                                                                    Zoho Sprints Resources


                                                                      Qntrl Resources


                                                                        Zoho Creator Resources



                                                                            Zoho CRM Resources

                                                                            • CRM Community Learning Series

                                                                              CRM Community Learning Series


                                                                            • Kaizen

                                                                              Kaizen

                                                                            • Functions

                                                                              Functions

                                                                            • Meetups

                                                                              Meetups

                                                                            • Kbase

                                                                              Kbase

                                                                            • Resources

                                                                              Resources

                                                                            • Digest

                                                                              Digest

                                                                            • CRM Marketplace

                                                                              CRM Marketplace

                                                                            • MVP Corner

                                                                              MVP Corner





                                                                                Design. Discuss. Deliver.

                                                                                Create visually engaging stories with Zoho Show.

                                                                                Get Started Now


                                                                                  Zoho Show Resources


                                                                                    Zoho Writer Writer

                                                                                    Get Started. Write Away!

                                                                                    Writer is a powerful online word processor, designed for collaborative work.

                                                                                      Zoho CRM コンテンツ






                                                                                        Nederlandse Hulpbronnen


                                                                                            ご検討中の方





                                                                                                  • Recent Topics

                                                                                                  • Cannot use a Zoho Form in CRM Email Template

                                                                                                    I've created a Zoho form that has integration with Zoho CRM and is linked to a custom module. I know the form works as I have tested it. When I try and insert this Zoho Form in a button on a CRM email template set up with the same custom module I get
                                                                                                  • Function Only Working Manually

                                                                                                    Good evening everyone. I have a function that creates a PDF from a Creator form. When I execute it manually it works perfectly. But when I execute it from within a On success workflow it is not working. I'll post my code below. Any ideas? //Function void
                                                                                                  • How to send binary data in invokeurl task?

                                                                                                    Hello, I am using Adobe's Protect PDF API. Source: https://developer.adobe.com/document-services/docs/overview/pdf-services-api/ Everything works fine in Postman. But for some reason after encrypting the file, it is empty after password protecting the
                                                                                                  • Campaign email bounces and CRM entries

                                                                                                    Using campaigns.zoho.com and utilizing a sync'd list works fine.  But when emails bounce, they are removed from the campaign side, but there is no way to update the CRM record.    You can see that the email bounced in CRM by looking at campaigns-> member status, but you can not use that field to create a search or any other way in which to update those bad records.    I have a list of several thousand emails, and to update each record that bounces is a nightmare.  There has to be a way to utilize
                                                                                                  • Has anyone integrated SMS well for Zoho Desk?

                                                                                                    Our company does property management and needs to be able to handle inbound sms messages which create a ticket for Zoho Desk.  We then need to be able to reply back from Zoho desk which sends the user an sms message.  This seems like a fairly common thing to need - sms handling for support tickets.  There is basically no good information from any third party vendor for Zoho Desk, while there is a ton for CRM.  Zoho is pretty unhelpful when I've reached out to them, and a lot of vendors just direct
                                                                                                  • Tags When Importing

                                                                                                    My biggest wish right now for making Zoho Notebook easier to work with would be to have the ability to add tags while importing files/clips. This includes using the web clipper, adding web pages with Share on my phone, and adding pages by using Attach.
                                                                                                  • WhatsApp in Zoho Social

                                                                                                    Seems CRM team is not taking Whatsapp integration seriously. While Facebook already has 63 Whatsapp partners, some of which are very small, that have already completed API integration. Maybe the social team could take over this project from CRM and get
                                                                                                  • Allow users to display columns dynamically

                                                                                                    I have a table with 50 users in Column A and the dates 1 Jan to 31 Dec along Row 1. I want users to be able to add data to the cells but would like to make it easier by allowing users to select a date and display that. So if the user wants to add data
                                                                                                  • Download fails

                                                                                                    We are unable to download data. When we try, we get the message "Download failed." We have two Bases. Downloads are working in one but not the other. The Base with the problem is 'Projects'. We're trying to download Time Records from the Month view. Note:
                                                                                                  • Webhook when estimate is refused is not firing

                                                                                                    Hello, I use a workflow through make that sends estimate with zoho books (I paid books and sign). -Those estimates when accepted are firing the webhook that I create in zoho sign (photo 1) -However when refused they are not firing the webhook that I created
                                                                                                  • RFQ MODEL

                                                                                                    A Request for quotation model is used for Purchase Inquiries to multiple vendors. The Item is Created and then selected to send it to various vendors , once the Prices are received , a comparative chart is made for the user. this will help Zoho books
                                                                                                  • Calculations in item custom field

                                                                                                    Dear Sirs,    Is it possible to do math inside items in Zoho Books? My item is a pack of plywood. Depending on thickness, there is certain amount of sheets in a pack and, as the result, different volume. I want to add fields like lenth, width, thickness,
                                                                                                  • I can't send and receieve any email ERROR CODE :550 - 5.7.26

                                                                                                    Hello, I can't receive and send any email for months. I already sent an email to Zoho support but didn't get any response. I attached a screenshot of a message i get always when i tried to send an email. Please help me asap.
                                                                                                  • Zoho Email Not Working After Domain Transfer and Nameserver Change

                                                                                                    Dear all, I hope you're all doing well. We recently transferred our domain, which is linked to Zoho, to another hosting provider. As part of the transfer, we updated the nameservers to the new hosting provider's ns1 and ns2. However, after this change,
                                                                                                  • Linkedin - Recruiter System Connect

                                                                                                    Hi there! Does anyone here know how to connect Zoho Recruit to Linkedin Recruiter via Recruiter System Connect?
                                                                                                  • 2025 Just Got More Exciting for Developers!

                                                                                                    Hello, Greetings to the Zoho Books Community! As we step into the New Year, we're thrilled to roll out something truly special for our Zoho Finance enthusiasts – the "Zoho Finance Developer" Community! This is your exclusive space to connect with fellow
                                                                                                  • Does Client Script work on Zoho CRM Portal?

                                                                                                    Hi ! I create a new module to use at customer portal. But Client Script looks not work. Please help me clarify, thank you!
                                                                                                  • Create custom rollup summary fields in Zoho CRM

                                                                                                    Hello everyone, In Zoho CRM, rollup summary fields have been essential tools for summarizing data across related records and enabling users to gain quick insights without having to jump across modules. Previously, only predefined summary functions were
                                                                                                  • Alter a system defined field from a 'single line' into a picklist

                                                                                                    Hello,  I am looking to switch the STATE field, which is a Zoho defined field from a 'single line' into a picklist. Can you advise how to change this?
                                                                                                  • SOLVED: Stopping Multiple Invitations when sync with Google Calendar

                                                                                                    I wanted to share this solution as I wasn't able to find it when searching through the Zoho community and via web search. The issue: When requestor books a meeting through Zoho Bookings, the requestor receives a confirmation email from both Bookings and
                                                                                                  • Zoho Analytics - Data source timezone

                                                                                                    Hi, I have a Zoho Desk data source that should display date information / timestamps in Europe/Paris timezone (CET/CEST). However, as shown in the attached screenshot, the data source is using America/Mexico_City timezone despite having my Locale Information
                                                                                                  • Merging Writer Titles

                                                                                                    When merging from CRM into Writer, is there a way to add fields to the document header? This would be very helpful for saving. Is there a way to link the document automatically to the module?
                                                                                                  • Taxes... again.

                                                                                                    After reading the recent addition to the knowledge-base article at https://help.zoho.com/portal/en/kb/commerce/user-guide/settings/general-settings/articles/types-of-taxes, I feel compelled for the fourth year now to reiterate the glaring omission in
                                                                                                  • View tickets

                                                                                                    Is it possible to have 1 person in a organization which can view all tickets of that company? Example: IT Manager of Company X wants to view all tickets of Company X, no other user can see  all tickets of Company X.
                                                                                                  • Automatically associate contact with product

                                                                                                    Hello, I created a Real State scenario at CRM where I have property owners that are contacts, and properties that are products. After creating a contact and a product, I associated them. My Desk is integrated with my CRM, and it automatically creates
                                                                                                  • Zoho Desk Deluge get tickets info

                                                                                                    When using Deluge, Need to use "tickets" to obtain ticket information. Example : ticketDetails = zoho.desk.getRecordById(XXXXXX,"tickets",ticketId); Is there a way for me to query ticket information while only knowing "ticketNumber"? The "ticket Number"
                                                                                                  • What is the Desk API?

                                                                                                    I'm trying to fetch a lookup field data from desk to our creator application and it doesn't work. I'm guessing that my search parameter is wrong? On my trial function fetch if I use these: tickets = invokeurl [ url :"https://desk.zoho.com/api/v1/tickets/351081000145244764"
                                                                                                  • Zoho still running very slow

                                                                                                    I have a lead log for my company and creator seems to be running extremely slow still.
                                                                                                  • How to link Custom Fields in Ticket view

                                                                                                    Hi team, I have created 2 custom fields in our Accounts Module would like them to show in our ticket information. We don't have Enterprise so I cannot do it via a workflow, but I know you can do lookup fields to link modules. How would I go about making
                                                                                                  • Sending a Slideshow as a scheduled email

                                                                                                    I have created a slideshow for my dashboards - is there anyway of automating or scheduling it to send to users ?
                                                                                                  • How can I send out edm email without execced the mail limit and got block?

                                                                                                    Hello, What service should I subscribe and pay for?? Thanks Tomuel
                                                                                                  • Global "Search" in FSM

                                                                                                    I'm missing the global Search function like in CRM. This should save us a lot of time. We don't now upfront if the customer is a Contact or a Company. So now we have to guess in what module to start a search/filter. Also looking up an address, phone number,
                                                                                                  • Mapping of Zoho CRM Lookup field to CRM

                                                                                                    Hi, I have created a Zoho CRM Lookup field on a form for a client. The population of the field works great in the form however I cannot seem to get the data being entered in the form back into CRM. For example, the form is for new clients to fill in their
                                                                                                  • Lost Data

                                                                                                    I never synced it before but now since ir forced me to login... my data is lost. Can I still recover my local data?
                                                                                                  • Unable to verify Domain - Exabytes

                                                                                                    Hi, I have obtained a .com.my domain provided by Exabytes, but am unable to verify the domain ownership despite added in both TXT and CNAME as below: TXT - Name: @ ; Value: zoho-verification=zb88785805.zmverify.zoho.com CNAME - NAME: zb88785805 ; Value:
                                                                                                  • Enhanced Placeholder Preview for Templates

                                                                                                    Hi, When creating a new template in Zoho CRM, there are many variables/placeholders available, such as ${Organization.Organization Name} and ${Quotes.Created Time}. While these placeholders are useful, it is not always clear what each field represents,
                                                                                                  • Forgot password to my notebookd and notes

                                                                                                    Exactly what the title says. I know it sounds dumb since it's my own fault but what can I do? I'm just wondering if we can recover our password or something. I see there's no such feature but it should have right??? This is really frustrating to me because
                                                                                                  • Problems with email configuration and slowness in Zoho support.

                                                                                                    I've been having problems configuring emails since yesterday, they responded to me today, I sent a response right away and so far I haven't received a resolution to the problem. Attached are the configuration attempts that were made.
                                                                                                  • Ajuda! Não é possível enviar mensagem; Motivo: 554 5.1.8 E-mail enviado bloqueado

                                                                                                    Não estou conseguindo enviar email está aparecendo isso ai amorproprioterapias@amorproprioterapias.com.br
                                                                                                  • POP/SMTP issues with Gmail client & problem with support

                                                                                                    Hello! I've recently encountered an issue with POP/SMTP synchronization with my Gmail client. After issuing a ticket to Zoho support, the status shows up as "Invalid" and I haven't recieved any kind of reply. So I figured that maybe the community page
                                                                                                  • Next Page