Kaizen #134 Manipulating Rich Text Field (RTF) using Zoho CRM APIs

Kaizen #134 Manipulating Rich Text Field (RTF) using Zoho CRM APIs

 Hello everyone!

Last week, we discussed Deciding on the type of applications: Self-client or Server-based? This week, we will discuss the Rich Text Field (RTF) and how we can manipulate RTF using Zoho CRM APIs.
In this post, 
  1. What is a Rich Text Field (RTF)?
  2. Use case
  3. Rich Text Field creation in a module using the Create Custom Field API
  4. Adding values to the RTF using the Insert Records API 

  5. Fetch complete data of RTF using the GET - Rich Text Field API 
  6. Updating Rich Text Field using the Update Records API 
  7. Deleting RTF using the Delete Custom Field API
  8. RTF using the COQL API
  9.  RTF using Bulk APIs

1. What is a Rich Text Field?

The Rich Text field is the preferred choice when there is a need for formatted text and a larger character limit. It can accommodate up to 50,000 characters, including HTML elements that are generated when the text is formatted, making it ideal for entries that require styling and organization, such as product descriptions or detailed client communications. Although tooltips can be added to improve user interaction, the rich text field does not support encryption or mandatory input settings.

Using rich text can improve the visual appeal of your information by providing different font styles, colors, and highlights. This allows for effective communication of important details. Bullet points and numbered lists can enhance readability, while bold, italics, or underlined texts can emphasize crucial information. Increased and decreased indents can help organize data, and the strikethrough feature can easily indicate changes or updates.

2. Use case

Consider Zylker, an org that uses Zoho CRM as their sales management system to store reports or feedback on its employees' sales performance report, total revenue, sales breakdown by product, key achievement, challenges faced, action plan, and to-do lists. These are stored in the multi-line field's rich text format type for better visuals and to identify the important information easily.

Let us see how to create RTFs using APIs, and how to access or update RTF using different available APIs. Note that the Rich Text type of multi-line field is supported from version 6.

3. Rich Text Field creation in a module using the Create Custom Field API

To create a rich text field in a module, first know the module's API name using the GET - Modules Metadata API, then create a custom RTF field in that module.

Request URL to create Rich Text Field : 
{api-domain}/crm/v6/settings/fields?module=Employees

Request Method : POST

Sample Input :
{
    "fields": [
        {
            "field_label": "Feedback",
            "data_type": "textarea",
            "length": 50000,
            "textarea": {
                "type": "rich_text"
            },
            "tooltip": {
                "name": "static_text",
                "value": "employee's feedback"
            }
        }
    ]
}


4. Adding values to the RTF using the Insert Records API 

To add values to the created rich text field, you should know its API name. 
Using the api_name of the Employees module, make a GET - Fields metadata API call to get the list of fields (along with their api_name) in the Employees module. Search for the field in which you need to add values to the Rich Text Field. In our case, it is Feedback.

Request URL : {api-domain}/crm/v6/Employees
Request Method : POST

Sample Input :

{
    "data": [
        {
            "Company": "Zylker",
            "Name" : "Patricia Boyle",
            "Email": "patricia@zylker.com",
            "State": "Texas",
            "Feedback": "<b>Sales Performance Report</b><br><br><span style=\"font-style:normal;\"><b>Salesperson Name: </b></span> Patricia<br><b>Reporting Period:</b>  Q1 2024<br><br><b>Total Sales Revenue Generated:</b> <i><u>$250,000</u></i><br><br><b>Sales Breakdown:</b><br><br><ul style=\"list-style-type:disc;list-style-position:inside;padding-inline-start:20px;\"><li style=\"color:rgb(51, 51, 51);\"><p style=\"display:inline;\"><span style=\"color:rgb(51, 51, 51);font-weight:normal;font-style:normal;\">Product A:</span><span style=\"background-color:rgb(93, 195, 90);color:rgb(51, 51, 51);font-weight:normal;font-style:normal;\"> $100,000</span></p></li><li style=\"color:rgb(51, 51, 51);\"><p style=\"display:inline;\"><span style=\"color:rgb(51, 51, 51);font-weight:normal;font-style:normal;\">Product B:</span><span style=\"background-color:rgb(239, 177, 22);color:rgb(51, 51, 51);font-weight:normal;font-style:normal;\"> $80,000</span></p></li><li style=\"color:rgb(51, 51, 51);\"><p style=\"display:inline;\"><span style=\"color:rgb(51, 51, 51);font-weight:normal;font-style:normal;\">Product C: </span><span style=\"background-color:rgb(22, 208, 239);color:rgb(51, 51, 51);font-weight:normal;font-style:normal;\">$70,000</span></p></li></ul><br><b>Key Achievements:</b><br><br><ul style=\"list-style-type:disc;list-style-position:inside;padding-inline-start:20px;\"><li><p style=\"display:inline;\"><span style=\"color:rgb(51, 51, 51);font-weight:normal;font-style:normal;\">Exceeded sales targets for Product A by</span><span style=\"background-color:rgb(255, 255, 255);color:rgb(51, 51, 51);font-weight:normal;font-style:normal;\">  </span><span style=\"background-color:rgb(0, 176, 80);color:rgb(51, 51, 51);font-weight:normal;font-style:normal;\">20%.</span></p></li><li style=\"color:rgb(51, 51, 51);\"><p style=\"display:inline;\"><span style=\"color:rgb(51, 51, 51);font-weight:normal;font-style:normal;\">Secured </span><span style=\"background-color:rgb(125, 207, 123);color:rgb(51, 51, 51);font-weight:normal;font-style:normal;\">5 new clients for Product B</span><span style=\"color:rgb(51, 51, 51);font-weight:normal;font-style:normal;\">, contributing to a </span><span style=\"background-color:rgb(93, 195, 90);color:rgb(51, 51, 51);font-weight:normal;font-style:normal;\">25% increase </span><span style=\"color:rgb(51, 51, 51);font-weight:normal;font-style:normal;\">in sales.</span></p></li><li style=\"color:rgb(51, 51, 51);\"><p style=\"display:inline;\"><span style=\"background-color:rgb(93, 195, 90);color:rgb(51, 51, 51);font-weight:normal;font-style:normal;\">Closed a high-value deal for Product C with a revenue of $50,000.</span></p></li></ul><br><b>Challenges Faced:</b><span></span><br><ul style=\"list-style-type:disc;list-style-position:inside;padding-inline-start:20px;\"><li style=\"color:rgb(51, 51, 51);\"><p style=\"display:inline;\"><span style=\"color:rgb(51, 51, 51);font-weight:normal;font-style:normal;\">Market competition intensified, resulting in</span><span style=\"background-color:rgb(242, 69, 69);color:rgb(51, 51, 51);font-weight:normal;font-style:normal;\"> longer sales cycles</span><span style=\"color:rgb(51, 51, 51);font-weight:normal;font-style:normal;\">.</span></p></li><li style=\"color:rgb(51, 51, 51);\"><p style=\"display:inline;\"><span style=\"color:rgb(51, 51, 51);font-weight:normal;font-style:normal;\">Difficulty in accessing decision-makers for key accounts,</span><span style=\"background-color:rgb(242, 69, 69);color:rgb(51, 51, 51);font-weight:normal;font-style:normal;\"> leading to delays in closing deals</span><span style=\"color:rgb(51, 51, 51);font-weight:normal;font-style:normal;\">.</span></p></li><li style=\"color:rgb(51, 51, 51);\"><p style=\"display:inline;\"><span style=\"color:rgb(51, 51, 51);font-weight:normal;font-style:normal;\">Some clients expressed concerns about pricing,</span><span style=\"background-color:rgb(242, 69, 69);color:rgb(51, 51, 51);font-weight:normal;font-style:normal;\"> requiring additional negotiation efforts</span><span style=\"color:rgb(51, 51, 51);font-weight:normal;font-style:normal;\">.</span></p></li></ul><br><b>Action Plan:</b><br><ol style=\"list-style-type:decimal;list-style-position:inside;padding-inline-start:20px;\"><li style=\"color:rgb(51, 51, 51);\"><p style=\"display:inline;\"><span style=\"color:rgb(51, 51, 51);font-style:normal;\"><b>Targeted Marketing Campaigns:</b></span><span style=\"color:rgb(51, 51, 51);font-weight:normal;font-style:normal;\"> Launch targeted marketing campaigns to increase brand visibility and attract potential clients.</span></p></li><li style=\"color:rgb(51, 51, 51);\"><p style=\"display:inline;\"><span style=\"color:rgb(51, 51, 51);font-style:normal;\"><b>Enhanced Networking:</b></span><span style=\"color:rgb(51, 51, 51);font-weight:normal;font-style:normal;\"> Strengthen networking efforts to establish connections with decision-makers and key stakeholders.</span></p></li><li style=\"color:rgb(51, 51, 51);\"><p style=\"display:inline;\"><span style=\"color:rgb(51, 51, 51);font-style:normal;\"><b>Client Retention Strategy: </b></span><span style=\"color:rgb(51, 51, 51);font-weight:normal;font-style:normal;\">Implement a client retention strategy to address pricing concerns and ensure customer satisfaction.</span></p></li></ol><br><b>To-Do Lists :</b><br>Continued focus on building strong<span style=\"background-color:rgb(255, 255, 0);\"> client relationships</span>, identifying <span style=\"background-color:rgb(255, 255, 0);\">new opportunities</span>, and leveraging resources effectively to<span style=\"background-color:rgb(255, 255, 0);\"> drive further sales growth in the upcoming quarters</span>."
        }
    ]
}


Notes:
  1. If you enter incorrect API names for fields, the system will skip them and the record will be created successfully, but the values won't be added. This rule applies to RTF too.
  2. When using the Insert Records API for bulk records creation and the Update Records API for bulk records update, you can add up to 50,000 characters to RTFs in each record.
  3. For details on supported HTML tags and their attributes, refer to the help document.

The below GIF shows the result of the above input in the UI.

 

When you add values using HTML tags to the RTF via API, the input will be transformed into formatted data.

5. Fetch complete data of RTF using the Rich Text Field API

The Rich Text Field supports up to 50000 characters. Using the GET - Records API, you can fetch only the first 500 characters of the rich text field ('Feedback' in our case) in the response. If the @has_more property in the GET- Records response is true for the Rich Text Field (RTF) value, it indicates that the RTF contains more than 500 characters.


To fetch the entire data, we have introduced the GET - Rich Text Field API in V6, enabling the retrieval of complete data from rich text fields.

Below Sample shows how to fetch full data :

Request URL : {api-domain}/crm/v6/Employees/5725767000002594018/actions/fetch_full_data
Request Method : GET

Response :


6. Updating Rich Text Field using the Update Records API 

Updating a rich text field doesn't require any special steps. It is similar to the process how we update other fields in a record, using the Update Records API.


7. Deleting RTF using the Delete Custom Field API


General notes :
  • Rich text fields are not supported in subforms, List View, Kanban View, Canvas View, Sheet View, Related Lists, Lookup popup, global search, filters and criteria, formula fields, report export, and integrations.
  • Rich text fields are not supported in the Search API.
  • Rich text fields are supported for importing and exporting records, using the Bulk APIs. The data will be exported as HTML content. For example, Patricia will be exported as <b>Patricia</b>.

8. Rich Text Field using the COQL API

Retrieve the Rich Text Fields from a module through a COQL query.  Note that RTFs cannot be used in the criteria. Similar to the GET - Records API, the COQL API response fetches up to 500 characters of the RTFs. To fetch its complete data, use the GET - Rich Text Field API.

Request Method : POST

Sample Input :

 {
    "select_query":"select 'Feedback' from Employees where Company is not null"
 }


Response :


9. Rich Text Field using Bulk APIs

Bulk Read API allows you to fetch a large set of data i.e., you can fetch a maximum of 200,000 records in a single API call. You can export complete data of rich text fields in a module. Note that RTFs cannot be specified in the criteria. 

Request Method: POST

Sample input :

{
    "callback": {
        "method": "post"
    },
    "query": {
        "module": {
            "api_name": "Employees"
        },
        "file_type": "ics"
    }
}


The Bulk Read API is an asynchronous API, the response will not be available instantly; the bulk read job is scheduled. Once the job is completed, it'll be notified in the callback URL. The records are available in a downloadable CSV file or ICS file (for events). 

Below is a sample downloaded CSV file:
Unlike the GET - Records API, the Bulk Read API fetched the RTF's complete data.



See our Bulk Read API documentation to know how to view the status of the scheduled job and download the file in detail, along with more sample requests and responses.

Bulk Write API allows you to insert, update, or upsert a large set of data. In the CSV file module, using the Bulk Write API, you can add up to 50000 characters to the RTFs for each record in a row.

Prepare your CSV file
The Bulk Write API only accepts a CSV file compressed into a ZIP file as input. 

Below picture represents values added to the rich text field:

Please ZIP the CSV file once you add values to the Rich Text Field.

Upload your CSV file :
This involves making a POST API call, with the ZIP file containing the required data. 

Headers
               Header Name
                                   Description
 feature
 bulk-write
 X-CRM-ORG
 Your zgid which you get from the Organization API

Request Method: POST



Create a bulk write job :
Request URL : {{api-domain}}/crm/bulk/v6/write
Request Method : POST

Sample Input for bulk insert :

{
    "operation": "insert",
    "ignore_empty": true,
    "callback": {
        "method": "post"
    },
    "resource": [
        {
            "type": "data",
            "module": {
                "api_name": "Employees"
            },
            "file_id": "5725767000002613001",
            "file_names": [
                "Rich.csv"
            ],
            "field_mappings": [
                {
                    "api_name": "Name",
                    "index": 0
                },
                {
                    "api_name": "Feedback",
                    "index": 1
                },
                {
                    "api_name": "Company",
                    "index": 2
                }
            ]
        }
    ]
}

Refer to our Bulk Write API help document and get more information on how the Bulk Write API works, how to prepare your CSV file, and how to upload your CSV file, and how to check the job status.

We trust that this post meets your needs and is helpful. Let us know your thoughts in the comment section or reach out to us at support@zohocrm.com

Stay tuned for more insights in our upcoming Kaizen posts!

Cheers!

Previous Kaizen Post :
Kaizen #133 - Deciding on the type of applications: Self-client or Server-based?                                                                              

Additional Reading :

Join us for our upcoming Zoho CRM Developer Series: Zoho CRM APIs, where you can explore more about Zoho CRM APIs. Register Now!


    • Recent Topics

    • Email undelivered

      GOod Day I am always receiving an uncategorized-bounce to my email. I am not sure why this is happening.
    • Add inventory_valuation_method to items endpooints

      To ensure consistent item creation it would be helpful to have the inventory_valuation_method (FIFO vs WAC) be able to be set at item creation or as an update (consistent with current behavior where it is not allowed for items with existing transactions)
    • Use Zoho to send sales receipts for Gocardless transactions

      I've been using gocardless for years and have d/d mandates set up on there. Each week we get bulk payments from customer d/d's. However, we need to send sales receipts to these customers. So I know I can sync mandates into Zoho, and then I can set up
    • Zoho - Gocardless sales receipts

      I've been using gocardless for years and have d/d mandates set up on there. Each week we get bulk payments from customer d/d's. However, we need to send sales receipts to these customers. So I know I can sync mandates into Zoho, and then I can set up
    • Introducing Rollup summary in Zoho CRM

      ------------------------------------------Moderated on 5th July'23---------------------------------------------- Rollup summary is now available for all organizations in all the DCs. Hello All, We hope you're well! We're here with an exciting update that
    • Introducing Connected Workflows in Zoho CRM for Everyone : Free Your Teams to Focus on What Matters

      Hello Everyone, We’re thrilled to introduce the next big evolution in Zoho CRM for Everyone -- Connected Workflows. This new feature builds on our commitment to deliver a CRM that’s truly inclusive, adaptable, and designed for consistent collaboration
    • Cooling-off Period Just Got Better: More Coverage, More Control

      We’ve enhanced the Cooling-off Period feature in Zoho Recruit to give you more control over repeat applications and referrals. This helps you maintain a cleaner, more efficient recruitment pipeline. With this enhancement, you can: Prevent duplicate candidate
    • Revenue Management: #7 Revenue Recognition in Construction & Real Estate Industry

      If you are in the construction or real estate business, you are used to long project timelines and progressive invoicing to keep up with your billing. But when does revenue get recognized? Will it happen when the contract gets signed? At different milestones
    • TikTok (and other social platform) Messages and comments of the past

      When I link a social channel, Zoho will show in "Inbox", "Messages" and "Contact" sections the interaction done in the past? (comment, messages...)
    • Restrict Employee mail deletion

      Dear Zoho, Is there a way where i can restrict my employees to delete any mails from their account
    • 554 5.1.8 Email Outgoing Blocked.

      Hi guys, I just singed up for mateusz.nowicki@zoho.com mail and I can't send any mails.. Why? Everytime I try to send something I got error like the one in the screenshot. Please, help me.
    • Zoho IP blocked by SpamHaus

      ERROR CODE :550 - 5.7.0 Your server IP address is in the SpamHaus SBL-XBL database, bye
    • File Upload in Creator's Subfrom

      Hello Sir/Madam, Here is a Problem......... Scenario: In CRM One Custom Module (Payments) have one File Upload Field now we have to Upload that File into Creator's Custom Form (Documents) have one Subform (Documents) in Document Upload Field using Deluge
    • Trigger workflow base on email clic

      Searching the help and forum, I see that there were workflow trigger rules based on email. But now, I can't find this type of trigger when I create a custom workflow. What I'm looking for would be to automate the sending of an email for a new prospect,
    • Bigin Form Acknowledgement

      How to troubleshoot and find out why form acknowledgement is not sending emails after form submission?
    • Option to Customize Career Site URL Without “/jobs/Careers”

      Dear Zoho Recruit Team, I hope you are doing well. We would like to request an enhancement to the Career Site URL structure in Zoho Recruit. In the old version of the career site, our URL was simply: 👉 https://jobs.domain.com However, after moving to
    • Zoho Mail POP & IMAP Server Details

      Hello all! We have been receiving a number of requests regarding the errors while configuring or using Zoho Mail account in POP/ IMAP clients. The server details vary based on your account type and the Datacenter in which your account is setup. Ensure
    • Ever since the new Android App udpates notifications are not working

      notifications are not working for the app is its closed I followed the tutuorial to the notificaction fixed and everythig seems to be right but notifications are not workig
    • Zoho Analytics & Zoho Desk - but not all desks

      I have several desks in our company and one of those is used by our HR department. I want to bring through the data to the shared Zoho Analytics workspace - except for the HR desk. Can this be excluded at data import stage ?
    • Incoming Emails Not Showing Up in Zoho Inbox

      Hi - I have my Zoho email account set up to forward a copy of all incoming emails to a secondary Gmail address, whilst retaining the original email in the Zoho inbox. However, all my incoming emails are currently not showing up in my Zoho inbox, so I'm
    • Unable to Create Zoho Booking via the Book Appointment API

      Its giving the below error {     "response": {         "errormessage": "Error setting value for the variable:customer_details\n null",         "status": "Error"     } } Request: POST Url: https://www.zohoapis.in/bookings/v1/json/appointment attached Zoho-oauthtoken
    • SHEET - Send email when a cell changes

      I would like to create a custom function for Zoho Sheet that triggers when a paticular cell changes to a specific value. This would result in sending an email to a recipient (this would be an address that remains the same and included in the script). Example: = IF(N4= "Drafted", <>EmailFunction) 1)     Cell N4 changes to "Drafted" 2)    Email is sent to recipient            or alternatively 3)    Post to chat channel I have found the Custom function editor in Sheet. I am not bad at scripting, but
    • 【開催報告】 福岡 ユーザー交流会 2025/8/8(金)

      皆さま、こんにちは。コミュニティチームの中野です。 8/8(金)に、福岡 ユーザー交流会を開催しました。 本投稿では、その様子をお届けします。当日の登壇資料などもこちらに共有しますので、参加できなかった皆さまもご参照ください。 今年初の開催となる福岡 ユーザー交流会では、CreativeStudio樂合同会社 前田さんによるZoho CRM / Sign / Survey の事例セッションのほか、 Zoho社員セッションでは、Zoho Forms の活用法を解説。 さらに、「見込み客・顧客データの管理/活用方法」をテーマに参加者同士でZoho
    • no me llegan los correos a Zoho mail

      No puedo recibir correos pero sí enviarlos, ya hice la modificación de MX y la verificación de teléfonos, qué es lo que ocurre? gracias
    • Error: Invalid login: 535 Authentication Failed

      I have used zoho with nodemailer. const transporter = nodemailer.createTransport({ host: 'smtp.zoho.com', port: 465, secure: true, auth: { user: 'example@example.com', pass: 'password' } }); While sending the mail, it shows the following error: Error:
    • Zoho Renewal

      Hello, If I am not going for zoho email renewal. will i get back my free zoho account? and if yes then is it possible to get back my all free user. how many user get back 10 or 25?
    • Not reciving emails

      Apparently i cannot recive emails on my adress contact@sportperformance.ro I can send, but do not recive. The mail i'm trying to send from mybother adress gets sent and doesn't bounce back... but still doesn't get in my inbox. Please advise
    • Not receiving MailChimp verification e-mail

      It seems that their verification e-mails are blocked. I can receive their other e-mails, but not their verification of domain ownership e-mail. I've checked and double checked how I typed the e-mail, using different e-mails (my personal e-mail can receive it), white listing the domain and all that is left is for the IP's to be white listed, but I don't have that power.  If a staff member could take a look at this -> http://mailchimp.com/about/ips/ And perhaps white list them for me, that would be
    • Creating my 2nd email account

      After creating my first email address, I decided to get another email address. I would like to use this new address as the primary address too. I don't know how to set it up there doesn't seem to be an option for that
    • Cannot - create more email account - Unusual activity detected from this IP. Please try again after some time

      Hello, I come across the error message in Control Panel. Unusual activity detected from this IP. Please try again after some time and i cannot create any more users We are an IT company and we provide service for another company Please unlock us.
    • "Unable to send message;Reason:553 Relaying disallowed. Invalid Domain"

      Good day. When I try to send mail through ZOHO mail I get the following error : "Unable to send message;Reason:553 Relaying disallowed. Invalid Domain" I need help with this. My zohomail is : @eclipseweb.site Thank you,
    • Transfert de domaine pour création des comptes emails

      Bonjour , je ne parviens point à créer des mails avec le domaine 'raeses.org' suite à la souscription du domaine auprès d'un autre hébergeur, dont j'ai fait la demande du code de transfert qui est le suivant : J2[U8-l0]p8[ En somme, attente de l'activation
    • Help! Unable to send message;Reason:554 5.1.8 Email Outgoing Blocked.

      Kindly help me resolved this issue that i am facing here.
    • How are people handling estimates with Zoho inventory?

      We are often using Zoho Books for estimates that then get converted to invoices within Books. We would like the sales team to migrate entirely to Zoho Inventory and no longer need to use Zoho Books so that they are only on one system. How are people managing
    • Relative Date Searches

      Currently in the search options, it has "date", "from date" and "to date". I think it would be great if there were options like "date greater than x days ago" and "date less than x days ago". I realise that as a once off you can just use the existing
    • Performance is degrading

      We have used Mail and Cliq for about three years now. I used to use both on the browser. Both have, over the past 6 months, had a severe degradation in performance. I switched to desktop email, which appeared to improve things somewhat, although initial
    • Ask the Experts 23: Customize, utilize, and personalize with Zoho Desk

      Hello everyone! It's time for the next round of Ask the Experts (ATE). This month is all about giving Zoho Desk a complete makeover and making it truly yours. Rebrand Zoho Desk with your organization’s details, customize ticket settings based on your
    • Dear Zoho CEO: Business Growth is about how you prioritise!

      All of us in business know that when you get your priorities right, your business grows. Zoho CRM and Zoho Books are excellent products, but sadly, Zoho Inventory continues to lag behind. Just this morning, I received yet another one-sided email about
    • Payroll In Canada

      Hi, When can we expect to have payroll in Canada with books 
    • Please review and re-enable outgoing emails for my domain

      Hello Zoho Support, I have recently purchased a new domain and set up email hosting with Zoho. However, my account shows "Outgoing Email Blocked". I am a genuine user and not sending bulk/spam emails. Please review and re-enable outgoing emails for my
    • Next Page