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

    • Two factor authentication for helpdesk users

      The company i work for wants use the helpdesk site in Zoho desk, as a place for their distribution partners to ask question and look for information about our product. The things there is suppose to go up there is somewhat confidential between my company
    • Remove "Invalid entries found. Rectify and submit again" modal

      Following up on a post from a few years back, but can the Zoho team consider either removing the 'Invalid entries found. Rectify and submit again' modal that displays for empty mandatory fields OR allow an admin to change it? I've built a custom error
    • Insurance Agencies

      I am reaching out to see if anyone has any experience in the Insurance Agency world with using Zoho exclusively for the CRM and commissions side of things. Lots of strong features like drip campaigns, meeting, calendars, emails, can all be found in here.
    • Problem with Egyptian internet ISP

      Dears,  We have problem with our ADSL internet SP, That your site not working with. So, we contact them and they asking us to contact you to solve this problem.  The problem that when we are connecting to Tedata ADSL your website not working (Business Email).  BR,, Mohamed Omar 
    • Emails not being received from a particular domain

      Cannot receive any emails sent from atco.com Domain is in the spam whitelist so should be no reason for it not to be coming through. Have filed a ticket and besides a generic response of we are looking at it - it seems there is no actual support workers
    • Mail Not Showing In Inbox or Sent Box

      Hi, there are mails that are not displaying in both my inbox and sent box. I just tried the iPad app and it is the same but there is a blank field where a mail should be and it refers to a server error. Please fix this.
    • Marketing Automation List Entry Criteria is no longer an option

      For a couple of years now we have used the "List Entry Criteria" option to filter our Journey recipient list. All of a suddent the option no longer exists for New Lists and I can only delete the option from existing lists but can no longer edit it. Anyone
    • GCLID arrives not in CRM with iframe integrated ZOHO Form

      Hello amazing community, I enabled Adwords integration in ZOHO CRM. I have a ZOHO Form integrated in a wordpress. I tested iframe and Javascript. I enabled the "handover" GCLID in the ZOHO Form. When I add a GLID with http://www.example.com/?gclid=TeSter-123.
    • How to overcome Zoho Deluge's time limit?

      I have built a function according to the following scheme: pages = {1,2,3,4,5,6,7,8,9,10}; for each page in pages { entriesPerPage = zoho.crm.getRecords("Accounts",page,200); for each entry in entriesPerPage { … } } Unfortunately, we have too many entries
    • Add Webhook Response Module to Zoho Flow

      Hi Zoho Flow Team, We’d like to request a Webhook Response capability for Zoho Flow that can return a dynamic, computed reply to the original webhook caller after / during the flow runs. What exists today Zoho Flow’s webhook trigger can send custom acknowledgements
    • Bidirectional sync between Zoho Bookings and Zoho CRM - Part 1

      Hey, community members! The default integration between Zoho CRM and Zoho Bookings is unidirectional, which means that any appointments booked, rescheduled, or deleted in Zoho Bookings will be reflected in Zoho CRM. However, any modifications made to
    • Is it possible to edit placeholder text?

      In the master slides I want to make sure my templates have more meaning for the users and want to replace the standard placeholder text with something more instructional. Instead of "Click to edit Mast subtitle styles" I want to have "Click to enter reporting
    • Delay function execute

      I've got a workflow which uses a webhook to send information to Flow, which in return updates a record in Creator. Problem is, by the time this has executed, the rest of my script has run and can't find the (yet to be) updated info in the record. Is there
    • How to allow download of a file AFTER information is collected?

      I can't find this anywhere. Can someone help with what seems to be a pretty basic web function today? - File is stored in Workdrive - Prospect goes to a URL where the file is located - System requests prospect to enter "Name" and "Email" - An email is
    • Add Baseline methods to API

      There are no API methods for creating or querying baselines,  Use case: Customer is notified of the current project start date according to plan via another product/integration. We would like to auto create a baseline (Automated via API) at the point
    • Bulk Fill In & Edit PO/Bill/SO/Invoice

      Hello, I am adding stock in bulk on a PO, the system is automatically populating the Rate (price) and Tax from the item data. Problem is that the bill rate is different from the rate on the item data, so I have to manually erase each and enter the price.
    • Fixed Assets beg balance

      Hello, I trust you are well I'm a new zoho books user and I find it difficult to plug in the fixed assets balance and here's what I have done: 1- I imported the fixed assets data into the fixed assets module as per the instructions 2- the import process
    • Syncing with Google calendar, Tasks and Events

      Is it possible to sync Zoho CRM calendar, task and events with Google Calendar's tasks and events. With the increasing adoption by many major tool suppliers to sync seamlessly with Google's offerings (for instance I use the excellent Any.do task planning
    • CRM Deluge how can link attach file with workdrive file.

      Hi, We have create file at workdrive and would like to link to attachment at crm module by deluge. Right now can only upload it to attachment but can not link the file from workdrive. Thank you
    • Feature announcement: AI-powered document generator in Zoho Sign

      Hi there! We recently announced manual document creation by offering an editor within Zoho Sign. Today, we are excited to announce AI-powered document generation to help you draft agreements, purchase orders, and other important business documents in
    • Permanently deleted files

      Is there a way to get back permanently deleted files from your account if they were accidentally deleted and no longer recoverable from the recycling bin? I know I am probably screwed but I just figured I would ask.
    • Shared Mailbox in iOS app

      Hi, On the desktop I am using a Shared mailbox for our company's general mailbox that somebody else should be able to view. In the iOS app however I can't find it? Old sources on the internet says this isn't possible but that can't be right? Somebody
    • Tip #41- Simplify Compliance and Efficiency with Zoho Assist’s Data Cleanup Feature- 'Insider Insights'

      Managing device data efficiently is just as important as securing remote access. With Zoho Assist’s Data Cleanup feature, admins can easily remove outdated or unnecessary device records, keeping the console organized and secure. This action is carried
    • Revenue Management: #6 Revenue Recognition in Professional Services Industry

      If you run a consulting firm, agency, or any service-based business, you have a situation where you have signed the contract, maybe even sent the invoice, and have received some initial payments. So, can you consider this as revenue? What if the project
    • Zoho fsm scheduled maintenance dispatch

      Hi, I'm reaching out regarding an issue I'm encountering with the Scheduled Maintenance feature in Zoho FSM. I’m trying to configure it so that it automatically dispatches all maintenance jobs scheduled within the next 150 days, starting from today. However,
    • zoho.inventory.getRecords returns no records

      I running a custom function (Deluge) in Zoho Flow with a connection to Zoho Inventory. To debug the problem, I created the test function below. It returns "Number of contacts fetched: 0". This confirms that there's no issue with the org ID or connection
    • Zoho Campaigns Event timestamps do not propagate to Zoho CRM

      We have integrated Zoho CRM and Zoho Campaigns. But when looking at Contact records, the Campaign event data is missing the actual timestamps: especially when a particular email was sent. They're not in the Campaigns related list, and the cannot be found
    • Feature announcement - Simplifying document creation with Zoho Sign

      Hi there, We are pleased to announce the release of our document creation feature, enabling you to create, edit, and finalize documents like agreements, purchase orders, and contracts without relying on external tools or applications. &lt;br&gt; This
    • Integrating File Attachments in Zoho Flow Email Notifications

      Hi, I would like to be able to send an email once an entry is made in a form, and in this email, I would like to attach a file that has been added to the form using the ImageUpload (or FileUpload) widget. So, I started by creating a flow that will trigger
    • Zoho project purchases

      Hi Folks, I think having a purchase module in projects will help in putting together a project p and L. Project wise purchases and expenses.  Do let me know your thoughts.
    • Create Tasklist with Tasklist Template using API v3

      In the old API, we could mention the parameter 'task_template_id' when creating a tasklist via API to apply a tasklist template: https://www.zoho.com/projects/help/rest-api/tasklists-api.html#create-tasklist In API v3 there does not seem to be a way to
    • How can I restore all the deleted Time entries of a Task in Zoho Projects

      How can I restore all the deleted Time entries of a Task in Zoho Projects? Query: In Zoho Projects, I cloned a task and deleted the time entries from the cloned task. However, this also deleted the time entries from the original task. How can I restore
    • Is there a way to make an account inactive in ZoHo Desk

      We have a few Clients "Accounts" that we no longer do business with. It would be beneficial for them to not show up in lists. However, we want to go back and view tickets, time, etc.
    • How to set the value of the Phone field importing contacts in Zoho Desk

      Hi everyone, i'm new in Zoho Desk, we're setting up the environment and i'm importing contacts from another CRM using a file CSV and i'm getting a problem with phone numbers (italian): the leading zero is cut away, also if the value is inside double quotes.
    • Set Custom Icon for Custom Modules in new Zoho CRM UI

    • Deprecation Notice: OpenAI Assistants API will be shut down on August 26, 2026

      I recieved this email from openAI what does it means for us that are using the integration and what should we do? Earlier this year, we shared our plan to deprecate the Assistants API once the Responses API reached feature parity. With the launch of Conversations,
    • How to center a field inside a section?

      I’ve been trying to center a field inside a section in Zoho Canvas. When I align it visually, it looks centered in the editor, but after clicking Save, the field appears misaligned on the actual canvas. I also tried setting the field to full width, but
    • Kaizen #192 - Implementing Custom Token Persistence in Python SDK

      Welcome back to another week of Kaizen! Last week, we discussed how to implement Login with Zoho using OAuth 2.0 and saw how to bring it to life in a real-world application with the Zoho CRM Python SDK. We also discussed how Zylker Academy built a custom
    • Showing the map along with mileage expense

      When you use the GPS to track mileage, it shows you the map of the actual path travelled. It would be very useful and practical to save that map with the mileage expense, so that when the report is created, it provides a map of each mileage expense associated
    • Enable Validation Rule for Multi-Select Picklist Field

      Zoho, Please allow validation rules for multi-select fields.
    • Next Page