Kaizen #145 - Assigning values to different field types using Zoho CRM SDKs - Part III

Kaizen #145 - Assigning values to different field types using Zoho CRM SDKs - Part III



Welcome to another Kaizen week!

In Part I of our series, we explored the various field types in Zoho CRM in detail and demonstrated how to assign values to these fields using our Java SDK. In Part II, we continued by showing you how to work with these field types using our PHP SDK.

This week, in Part III, we will discuss in detail on assigning values to different field types using our Python SDK. If you missed our previous posts, we recommend checking out Part I and Part II before moving forward. 

3. Python SDK

For more details on Python SDK, please refer to the GitHub repository for our latest Python SDK. Check out the sample codes here.

Standard Fields:

a. Import the Field Class:
  1.       from zohocrmsdk.src.com.zoho.crm.api.record import Record
  2.       record = Record()

b. Assign Values to Standard Fields: The syntax uses the add_field_value method of the Record object:
  1.       record.add_field_value(Field.{module_api_name}.{field_api_name},value);
Field Type
JSON Type
Assign Value
Assign Null Value
text (single line)
string 
record.add_field_value(Field.Leads.last_name(), "Last Name");
record.add_field_value(Field.Leads.last_name(), None);
textarea (multiline)
string
record.add_field_value(Field.Leads.description(), "Add your description here");
record.add_field_value(Field.Leads.description(), None);
email
string
record.add_field_value(Field.Leads.email(), "abc@zoho.com");
record.add_field_value(Field.Leads.email(), None);
phone
string
record.add_field_value(Field.Leads.phone(), "91(987)654321");
record.add_field_value(Field.Leads.phone(), None);
picklist
string
record.add_field_value(Field.Leads.lead_status(), Choice("Not Contacted"));
record.add_field_value(Field.Leads.lead_status(), None);
date
string
record.add_field_value(Field.Products.support_start_date(), datetime.date(2023, 6, 20));
record.add_field_value(Field.Products.support_start_date(), None);
datetime
string
record.add_field_value(Field.Calls.call_start_time(), datetime.datetime(2023, 11, 20, 10, 00, 1));
record.add_field_value(Field.Calls.call_start_time(), None);
integer (number)
integer
record.add_field_value(Field.Accounts.employees(), 100);
record.add_field_value(Field.Accounts.employees(), None);
currency (double)
double
record.add_field_value(Field.Leads.annual_revenue(), 10.00);
record.add_field_value(Field.Leads.annual_revenue(), None);
boolean (checkbox)
boolean
record.add_field_value(Field.Leads.email_opt_out(), True);
record.add_field_value(Field.Leads.email_opt_out(), None);
website (URL)
string
record.add_field_value(Field.Leads.website(), "https://www.zoho.com");
record.add_field_value(Field.Leads.website(), None);

Custom Fields:

To manage custom fields using Python SDK:
a. Import the Record Class:
  1. from zohocrmsdk.src.com.zoho.crm.api.record import Record
  2. record = Record()
b. Assign Values to Custom Fields: The syntax for assigning values to standard fields uses the add_key_value method of the Record object:

  1.       record.add_key_value("{field_api_name}", value);

Replace {field_api_name} with the appropriate values for your specific use case. 

Assigning values to Custom Fields:

Field Type
JSON Type
Assign Value
Assign Null Value
text (single line)
string 
record.add_key_value("Single_Line_Field", "Text Single Line 15");
record.add_key_value("Single_Line_Field", None);
textarea (multiline)
string
record.add_key_value("Multi_Line_Field", "Text Multi Line Field");
record.add_key_value("Multi_Line_Field", None);
email
string
record.add_key_value("Email_Field", "abc@zoho.com");
record.add_key_value("Email_Field", None);
phone
string
record.add_key_value("Phone_Field", "9900000000");
record.add_key_value("Phone_Field", None);
picklist
string
record.add_key_value("Pick_List_Field", Choice("Option 1"));
record.add_key_value("Pick_List_Field", None);
multiselectpicklist
JSON array
record.add_key_value("Multiselect_Field", [Choice("Option 1"), Choice("Option 2")])
record.add_key_value("Multi_Select_Field", None);
date
string
record.add_key_value("Date_Field", datetime.date(2023, 6, 20));
record.add_key_value("Date_Field", None);
datetime
string
record.add_key_value("Date_Time_Field", datetime.datetime(2023, 11, 20, 10, 00, 1));
record.add_key_value("Date_Time_Field", None);
integer (number)
integer
record.add_key_value("Number_Field", 12);
record.add_key_value("Number_Field", None);
currency (double)
double
record.add_key_value("Currency_Field", 10.25);
record.add_key_value("Currency_Field", None);
double
double
record.add_key_value("Decimal_Field", 12.25);
record.add_key_value("Decimal_Field", None);
percent 
double
record.add_key_value("Percent_Field", 12.25);
record.add_key_value("Percent_Field", None);
bigint (long integer)
string
record.add_key_value("Long_Integer_Field", 12345678);
record.add_key_value("Long_Integer_Field", None);
boolean (checkbox)
boolean
record.add_key_value("Checkbox_Field", True);
record.add_key_value("Checkbox_Field", None);
website (URL)
string
record.add_key_value("URL_Field", "https://www.zoho.com");
record.add_key_value("URL_Field", None);
lookup
JSON Object
account =.Record();
account.set_id(3477061000023362051);
record.add_key_value("Lookup_Field", account);
record.add_key_value("Lookup_Field", None);
multiselectlookup
JSON array
multi_select_list = []
record = Record()
record.add_key_value("id", 44024800152)
linking_record = Record()
linking_record.add_key_value("MultiSelectLookup", record)
multi_select_list.append(linking_record)   
record.add_key_value("MultiSelectLookup", multi_select_list)
multi_select_list = []
record = Record()
record.add_key_value("id", 4402493052)
linking_record = Record()
linking_record.add_key_value("MultiSelectLookup", record)
multi_select_list.append(linking_record)   
record.add_key_value("MultiSelectLookup", None)
userlookup
JSON object
user = MinifiedUser() 
user.set_id(3477061005791024)
record.add_key_value("User_Field", user)
record.add_key_value("User_Field", None)
multiuserlookup
JSON array
multiuser = []
record = Record();
linking_record = MinifiedUser()
linking_record.set_id(34770005791024)
record.add_key_value("MultiUser", linking_record)
multiuser.append(record)
record.add_key_value("MultiUser", multiuser)
multiuser = []
record = Record()
linking_record = MinifiedUser()
linking_record.set_id(347700005791024)
record.add_key_value("MultiUser", linking_record)
multiuser.append(record)
record.add_key_value("MultiUser", None)
subform
JSON array
subformList = []
subform = Record()
subform.add_key_value("Name", "SDK")
user1 = MinifiedUser();
user1.set_id(3477061000018959001)
subform.add_key_value("User_Field", user1)
subformList.append(subform)
record.add_key_value("Subform_Field", subformList)
subformList = []
subform = Record()
subform.add_key_value("Name", "SDK")
user1 = MinifiedUser();
user1.set_id(3477061000018959001)
subform.add_key_value("User_Field", user1)
subformList.append(subform)
record.add_key_value("Subform_Field", None)
imageupload
JSON array
image_upload = ImageUpload()
image_upload.set_file_id__s("ae94shudf7")
record.add_key_value("Image_Upload", [image_upload])
image_upload = ImageUpload()
image_upload.set_file_id__s("a184e4b87")
record.add_key_value("Image_Upload", None)
fileupload
JSON array
fileDetails = []
fileDetail1 = FileDetails()
fileDetail1.set_file_id__s("ed425d797bc");
fileDetails.append(fileDetail1)
record.add_key_value("File_Upload", fileDetails);
fileDetails = []
fileDetail1 = FileDetails()
fileDetail1.set_file_id__s("ed45d797bc");
fileDetails.append(fileDetail1)
record.add_key_value("File_Upload", None);
multi_module_lookup
JSON Object
record1 = Record()
record1.set_id(3477061000021552002)
module = dict()
module["id"] = "3477061000000002179"
module["api_name"] = "Contacts"
record1.add_key_value("module", module)
record.add_key_value("Appointment_For", record1)
--


We hope that this series has helped you gain a deeper understanding of managing different field types in Zoho CRM using our Java, PHP and Python SDKs. In the next part of this series, we will discuss about managing fields using our remaining SDK offerings. 

In the meantime, if you have any questions regarding field management with our SDKs, feel free to share them in the comments below, or send us an email at support@zohocrm.com. Your feedback is invaluable to us. 

We appreciate you joining us on this learning journey. Stay tuned for more informative and developer-centric posts in our Kaizen series every Friday!



Recommended Reads:









    Access your files securely from anywhere







                            Zoho Developer Community




                                                  • Desk Community Learning Series


                                                  • Digest


                                                  • Functions


                                                  • Meetups


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner


                                                  • Word of the Day


                                                  • Ask the Experts



                                                            • Sticky Posts

                                                            • Kaizen #222 - Client Script Support for Notes Related List

                                                              Hello everyone! Welcome to another week of Kaizen. The final Kaizen post of the year 2025 is here! With the new Client Script support for the Notes Related List, you can validate, enrich, and manage notes across modules. In this post, we’ll explore how
                                                            • Kaizen #217 - Actions APIs : Tasks

                                                              Welcome to another week of Kaizen! In last week's post we discussed Email Notifications APIs which act as the link between your Workflow automations and you. We have discussed how Zylker Cloud Services uses Email Notifications API in their custom dashboard.
                                                            • Kaizen #216 - Actions APIs : Email Notifications

                                                              Welcome to another week of Kaizen! For the last three weeks, we have been discussing Zylker's workflows. We successfully updated a dormant workflow, built a new one from the ground up and more. But our work is not finished—these automated processes are
                                                            • Kaizen #152 - Client Script Support for the new Canvas Record Forms

                                                              Hello everyone! Have you ever wanted to trigger actions on click of a canvas button, icon, or text mandatory forms in Create/Edit and Clone Pages? Have you ever wanted to control how elements behave on the new Canvas Record Forms? This can be achieved
                                                            • Kaizen #142: How to Navigate to Another Page in Zoho CRM using Client Script

                                                              Hello everyone! Welcome back to another exciting Kaizen post. In this post, let us see how you can you navigate to different Pages using Client Script. In this Kaizen post, Need to Navigate to different Pages Client Script ZDKs related to navigation A.


                                                            Manage your brands on social media



                                                                  Zoho TeamInbox 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

                                                                                              Get Started. Write Away!

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

                                                                                                Zoho CRM コンテンツ



                                                                                                  Nederlandse Hulpbronnen


                                                                                                      ご検討中の方




                                                                                                              • Recent Topics

                                                                                                              • How do I bulk archive my projects in ZOHO projects

                                                                                                                Hi, I want to archive 50 Projects in one go. Can you please help me out , How can I do this? Thanks kapil
                                                                                                              • ZOHO Work Drive Back Up

                                                                                                                I am looking for a ZOHO Work Drive backup solution. Something that is cloud based. There's lots of these kinds of options for Google Drive and other providers, but I have not seen anything for WorkDrive. Any suggestions?
                                                                                                              • ZOHO Reports - Filter Logic?

                                                                                                                Hi, I need a way to apply filter logics such as ((1 AND 2) OR 3). All I can see as of now is a way to enter different AND filters in the respective filter column. But how can I add an OR filter? Any advice would be highly appreciated. Mark
                                                                                                              • Scanned Doc - selecting Item overwrites Rate

                                                                                                                I have a Vendor Invoice which was uploaded to Documents. I select Add To > New Bill. The OCR is actually quite good, but it is reading an Item Description instead of an Item Number. I remove the description and select the correct Item Number... and it
                                                                                                              • Recruit API search

                                                                                                                Hi all, Attempting to call the search api endpoint from Postman using the word element as mentioned in api docs Search Records - APIs | Online Help - Zoho Recruit When making the call to /v2/Candidates/search?word=Saudi receive response of { "code": "MANDATORY_NOT_FOUND",
                                                                                                              • Manage control over Microsoft Office 365 integrations with profile-based sync permissions

                                                                                                                Greetings all, Previously, all users in Zoho CRM had access to enable Microsoft integrations (Calendar, Contacts, and Tasks) in their accounts, regardless of their profile type. Users with administrator profiles can now manage profile-based permissions
                                                                                                              • No funcionan correctamente el calculo de las horas laborales para informe de tickets

                                                                                                                Hola, estoy intentando sacar estadísticas de tiempo de primera respuesta y resolución en horario laboral de mis tickets, pero el calculo de horas en horario laboral no funciona correctamente cree los horarios con los feriados : Ajusté los acuerdos de
                                                                                                              • Zoho desk desktop application

                                                                                                                does zoho desk has a destop applicaion?
                                                                                                              • Saving reading position + Keep screen on

                                                                                                                While Zoho Notebook is excellent for saving and annotating articles, its utility is severely limited by the lack of reading progress synchronization. On the Android app, if a user exits a long note after reading 50%, the app fails to save the position.
                                                                                                              • Zoho LandingPage is integrated with Zoho One!

                                                                                                                Greetings to the Zoho One users out there! We're delighted to let you know that Zoho LandingPage is available in Zoho One too! With Zoho LandingPage, you can host custom-made landing pages, and persuade the visitors to dive deeper by making further clicks,
                                                                                                              • Android app sync problem - multiple devices have same problem

                                                                                                                Hello, I am having a problem with synchronization in the Android app. When I create a drawing, the data does not sync correctly—only a blank note is created without the drawing. I tested this on multiple devices, including phones and tablets, and the
                                                                                                              • How can i resend a campaign to only one of the recipients on the original campaign

                                                                                                                How can i resend a campaign to only one of the recipients on the original campaign ? Sincererly, Mike
                                                                                                              • Notes badge as a quick action in the list view

                                                                                                                Hello all, We are introducing the Notes badge in the list view of all modules as a quick action you can perform for each record, in addition to the existing Activity badge. With this enhancement, users will have quick visibility into the notes associated
                                                                                                              • How to show branch instead of org name on invoice template?

                                                                                                                Not sure why invoices are showing the org name not the branch name? I can insert the branch name using the ${ORGANIZATION.BRANCHNAME} placeholder, but then it isn't bold text anymore. Any other ideas?
                                                                                                              • Create CRM Deal from Books Quote and Auto Update Deal Stage

                                                                                                                I want to set up an automation where, whenever a Quote is created in Zoho Books, a Deal is automatically created in Zoho CRM with the Quote amount, customer details, and some custom fields from Zoho Books. Additionally, when the Sales Order is converted
                                                                                                              • Marketing Automation Requirements Questions

                                                                                                                I would like to set up a multi-email drip campaign- please see the structure below and confirm if I can achieve this set up in Zoho marketing automation. Where applicable, highlight gaps and workarounds. Thanks Drip email campaign- Can I create one drip
                                                                                                              • Sharing URLs and direct access

                                                                                                                Hello, I am storing my team's email signature images on Workdrive. I am creating a public image download share and adding “?directDownload=true” so that the image can be accessed without the Workdrive interface. A few questions: 1) Can we generate friendly
                                                                                                              • how to change the page signers see after signing a document in zoho sign

                                                                                                                Hello, How can I please change the page a signer sees after signing a document in Zoho Sign? I cannot seem to find it. As it is now, it shows a default landing page "return to Zoho Sign Home". Thanks!
                                                                                                              • Question about using custom_fields in Storefront Add-to-Cart API (error 2003 – required details)

                                                                                                                Hi everyone, I’m working with the Zoho Commerce Storefront API, specifically the Add to Cart endpoint: POST /storefront/api/v1/cart According to the documentation, this endpoint supports a custom_fields parameter for adding line-item custom data. I’m
                                                                                                              • Can a project be cloned?

                                                                                                                Good afternoon, greetings. I would like to ask if it's possible to clone a project in Microsoft Project. I found a way to do it using templates, but I'm not sure if there's a direct way to clone a project. Thank you in advance for your attention, and
                                                                                                              • Timesheet Tasks in Zoho Books: associate to service item

                                                                                                                How do we associate a service item to timesheet tasks in Zoho Books? For example: Joe spent 5 hours on project:task1 which is Service Item#1 (Income:Service1). When the invoice is issued thru the Project Invoice section, this is not available. When the
                                                                                                              • Why Sharing Rules do Not support relative date comparison???

                                                                                                                I am creating a Sharing Rule and simply want to share where "Last Day of Coverage" (Date field) is Greater than TODAY (Starting Tomorrow). However, sharing rules don't have the option to compare a date field to a relative date (like today), only to Static
                                                                                                              • Task/Activity indicator in SalesPipeline overview has disappeared

                                                                                                                I Just logged in my ZOHO CRM first 2026 checking my salespipeline overview , Every record card used to show an indication that there was an open task (Yellow if the expiry date was close, red if the expiry date was today and grey when it had expired).
                                                                                                              • Tip #56- Accessibility Controls in Zoho Assist: Hearing- 'Insider Insights'

                                                                                                                As we begin the new year, it’s a great time to focus on making our tools more inclusive and accessible for everyone. Remote support often involves long hours in front of screens, varying lighting conditions, and users with diverse accessibility needs.
                                                                                                              • JWT Token authentication problem that sometimes generates infinite redirect loops

                                                                                                                Description : Nous proposons un bouton sur notre plateforme permettant de rediriger l'utilisateur vers le portail ZohoDesk via un jeton JWT pour une authentification transparente. Cependant, il arrive que certains utilisateurs soient pris dans une boucle
                                                                                                              • Zoho Desk Android app update: Table view for All Departments view, custom button

                                                                                                                Hello everyone! In the latest version(v2.9.25) of the Zoho Desk Android app update, we have introduced Table view for the 'All Departments' view in the ticket module. We also have supported an option that allows tickets in the Table view to be sorted
                                                                                                              • What's New - December 2025 | Zoho Backstage

                                                                                                                In December, Backstage introduced a focused set of updates that improve how you manage registrations, communicate with attendees, and track participation. These enhancements are designed to give organizers greater flexibility and clearer control across
                                                                                                              • Need code format to specify default values

                                                                                                                Can someone please direct me to the code syntax or the proper translation per the instructions circled below. These instructions don't seem correct.
                                                                                                              • Add multiple users to a task

                                                                                                                When I´m assigning a task it is almost always related to more than one person. Practical situation: When a client request some improvement the related department opens the task with the situation and people related to it as the client itself, the salesman
                                                                                                              • A Roundup of Zoho Sprints 2025

                                                                                                              • Issue with WhatsApp Template Approval and Marketing Message Limit in Zoho Bigin

                                                                                                                We are facing issues while creating and using WhatsApp message templates through Zoho Bigin, and we request your clarification and support regarding the same. 1. Utility Template Approval Issue Until December, we were able to create WhatsApp templates
                                                                                                              • Sorting Custom Date in API isn't working w pagination limit

                                                                                                                How can we sort a custom field with DATE using pagination? Starting at page=1 then moving to page=2 with a limit of 10 each, its all messed up and even shows some of the same records as page 1? https://www.zohoapis.com/crm/v2/INVOICE_MODULE/search?criteria=(FM_Contact_ID:equals:1234)&sort_by=Invoice_Date&sort_order=desc&per_page=10&page='
                                                                                                              • SAP Business One(B1) integration is now live in Zoho Flow

                                                                                                                We’re excited to share that SAP Business One (B1) is now available in Zoho Flow! This means you can now build workflows that connect SAP B1 with other apps and automate routine processes without relying on custom code. Note: SAP Business One integration
                                                                                                              • Enhancement in Role and Profile mapping of agents in Sandbox

                                                                                                                Hello everyone! We have brought in a modification in the way users are mapped to a particular role and profile in Sandbox. What has changed? When agents are copied from production to Sandbox: If a user's current role and profile is available in Sandbox,
                                                                                                              • The reason I switched away from Zoho Notebook

                                                                                                                My main reason for switching to Zoho was driven by three core principles: moving away from US-based products, keeping my data within India as much as possible, and supporting Indian companies. With that intent, I’ve been actively de-Googling my digital
                                                                                                              • Decimal places settings for exchange rates

                                                                                                                Hello, We are facing issues while matching vendor payments with banking feeds. As we often import products/services exchange rate comes into play. Currently, ZOHO allows only six digits for decimal places. We feel that conversions like JPY to INR require
                                                                                                              • Zoho removed ability to see all Scheduled Reports!

                                                                                                                If you are not the owner of a scheduled report, Zoho recently removed the capability to see each scheduled report. As an admin who relies on seeing all scheduled reports being sent, this is a terrible update. Now I cannot see ANY scheduled reports...even the ones I am being sent!!  This should be a setting for admins to control.  This is a bad update.
                                                                                                              • Please can the open tasks be shown in each customer account at the top.

                                                                                                                Hi there This has happened before, where the open tasks are no longer visible at the top of the page for each customer in the CRM. They have gone missing previously and were reinstated when I asked so I think it's just after an update that this feature
                                                                                                              • Automate Backups

                                                                                                                This is a feature request. Consider adding an auto backup feature. Where when you turn it on, it will auto backup on the 15-day schedule. For additional consideration, allow for the export of module data via API calls. Thank you for your consideration.
                                                                                                              • GCLID and Zoho Bookings

                                                                                                                Is there anyway to embed a Zoho Bookings signup on a landing page and pass the GCLID information? More specifically, can this be done using auto-tagging and not manual tagging the GCLID? I know Zappier has an integration to do this but is there a better
                                                                                                              • Next Page