Skip to product menu
close
  • Recent Launches
    Press Space or Enter to display list of options
EXPLORE ALL PRODUCTS

Recent Launches

New

Payroll software with automated tax payments and filing.

Try now
New

Robotic process automation software to automate high-volume, rule-based tasks.

Try for free
New

Low-code IoT platform and solutions for connected businesses.

Try now
New

Business formation service to launch and grow your businesses.

Try now
New

Privacy-friendly application analytics solution.

Try for free

Sales

 
CRM

Comprehensive CRM platform for customer-facing teams.

CRM
 
Bigin

Simple CRM for small businesses moving from spreadsheets.

Bigin
 
Forms

Build online forms for every business need.

Forms
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
Sign

Digital signature app for businesses.

Sign
 
RouteIQ

Comprehensive sales map visualization and optimal route planning solution.

RouteIQ
 
Thrive

Complete loyalty and affiliate management platform.

Thrive
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
Suites
CRM Plus

Unified platform to deliver top-notch customer experience.

CRM Plus

Marketing

 
Social

All-in-one social media management software.

Social
 
Campaigns

Create, send, and track targeted email campaigns that drive sales.

Campaigns
 
Forms

Build online forms for every business need.

Forms
 
Survey

Design surveys to reach and interact with your audience.

Survey
 
Sites

Online website builder with extensive customisation options.

Sites
 
PageSense

Website conversion optimization and personalisation platform.

PageSense
 
Backstage

End-to-end event management software.

Backstage
 
Webinar

Webinar platform for webcasting online webinars.

Webinar
 
Marketing Automation

All-in-one marketing automation software.

Marketing Automation
 
LandingPage

Smart landing page builder to increase conversion rates

LandingPage
 
Publish

Manage all your local business listings on a single platform.

Publish
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Sign

Digital signature app for businesses.

Sign
 
Thrive

Complete loyalty and affiliate management platform.

Thrive
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
NEW
LeadChain

Sync, manage, and convert leads across channels seamlessly.

LeadChain
 
NEW
CommunitySpaces

Online community platform for individuals and businesses to grow their network and brand.

CommunitySpaces
 
Suites
Marketing Plus

Unified marketing platform for marketing teams.

Marketing Plus

Commerce

 
Commerce

eCommerce platform to manage and market your online store.

Commerce

Service

 
Desk

Helpdesk software to deliver great customer support.

Desk
 
Assist

Remote support and unattended remote access software.

Assist
 
Lens

Interactive remote assistance software with augmented reality.

Lens
 
FSM

End-to-end field service management platform for service businesses.

FSM
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
Suites
Service Plus

Unified platform for customer service and support teams.

Service Plus

Finance

 
Books

Powerful accounting platform for growing businesses.

Books
 
FREE
Invoice

100% Free invoicing solution.

Invoice
 
Expense

Effortless expense reporting platform.

Expense
 
Inventory

Powerful stock management and inventory control software.

Inventory
 
Billing

End-to-end billing solution for your business.

Billing
 
Checkout

Collect payments online with custom branded pages.

Checkout
 
NEW
Payroll

Payroll software with automated tax payments and filing.

Payroll
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo
 
Practice

Practice management software for accounting firms.

Practice
 
Sign

Digital signature app for businesses.

Sign
 
Commerce

eCommerce platform to manage and market your online store.

Commerce
 
Suites
Finance Plus

All-in-one suite to manage your operations and finances.

Finance Plus

Email and Collaboration

 
Mail

Secure email service for teams of all sizes.

Mail
 
Meeting

Online meeting software for all your video conferencing & webinar needs.

Meeting
 
Writer

Word processor for focused writing and discussions.

Writer
 
Sheet

Spreadsheet software for collaborative teams.

Sheet
 
Show

Create, edit, and share slides with a sleek presentation app.

Show
 
Notebook

Beautiful home for all your notes.

Notebook
 
Cliq

Stay in touch with teams no matter where you are.

Cliq
 
Connect

Employee experience platform to communicate, engage, and build positive employee relations.

Connect
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
TeamInbox

Shared inboxes for teams.

TeamInbox
 
WorkDrive

Online file management for teams.

WorkDrive
 
Sign

Digital signature app for businesses.

Sign
 
Office Suite

Powerful collaborative work platform for teams.

Office Suite
 
Office Integrator

Built in document editors for web apps.

Office Integrator
 
ZeptoMail

Secure and reliable transactional email sending service.

ZeptoMail
 
Calendar

Online business calendar to manage events and schedule appointments.

Calendar
 
Learn

Knowledge and learning management platform.

Learn
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
ToDo

Collaborative task management for individuals and teams.

ToDo
 
Tables

Work management tool to connect people, processes, and information.

Tables
 
FREE
PDF Editor

Collaborative online PDF editing tool.

PDF Editor
 
Suites
Workplace

Application suite built to improve team productivity and collaboration.

Workplace

Human Resources

 
People

Organize, automate, and simplify your HR processes.

People
 
Recruit

Intuitive recruiting platform built to provide hiring solutions.

Recruit
 
Expense

Effortless expense reporting platform.

Expense
 
Workerly

Manage temporary staffing with an employee scheduling solution.

Workerly
 
NEW
Payroll

Payroll software with automated tax payments and filing.

Payroll
 
Shifts

Employee scheduling and time tracking app.

Shifts
 
Sign

Digital signature app for businesses.

Sign
 
Suites
People Plus

Comprehensive HR platform for seamless employee experiences.

People Plus

Security and IT Management

 
Creator

Build custom apps to simplify business processes.

Creator
 
Directory

Workforce identity and access management solution for cloud businesses.

Directory
 
FREE
OneAuth

Secure multi-factor authenticator (MFA) for all your online accounts.

OneAuth
 
Vault

Online password manager for teams.

Vault
 
Catalyst

Pro-code platform to build and deploy your apps.

Catalyst
 
Toolkit

Complete resource for any admin-related lookup queries.

Toolkit
 
Lens

Interactive remote assistance software with augmented reality.

Lens
 
Assist

Remote support and unattended remote access software.

Assist
 
QEngine

Test automation software to build, manage, execute, and report testcases.

QEngine
 
NEW
RPA

Automate manual, tedious, and repetitive tasks easily.

RPA

BI and Analytics

 
Analytics

Modern self-service BI and analytics platform.

Analytics
 
Embedded BI

Embedded analytics and white label BI solutions, tailored for your needs.

Embedded BI
 
DataPrep

AI-powered data preparation service for your data-driven organization.

DataPrep
 
NEW
IoT

Harnessing IoT analytics for real-time operational intelligence.

IoT

Project Management

 
Projects

Manage, track, and collaborate on projects with teams.

Projects
 
Sprints

Planning and tracking tool for scrum teams.

Sprints
 
BugTracker

Automatic bug tracking software for managing bugs.

BugTracker
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo

Developer Platforms

 
Creator

Build custom apps to simplify business processes.

Creator
 
Flow

Automate business workflows by creating smart integrations.

Flow
 
Catalyst

Pro-code platform to build and deploy your apps.

Catalyst
 
Office Integrator

Built in document editors for web apps.

Office Integrator
 
ZeptoMail

Secure and reliable transactional email sending service.

ZeptoMail
 
QEngine

Test automation software to build, manage, execute, and report testcases.

QEngine
 
Tables

Work management tool to connect people, processes, and information.

Tables
 
NEW
RPA

Automate manual, tedious, and repetitive tasks easily.

RPA
 
NEW
Apptics

Application analytics for all apps.

Apptics
 
Embedded BI

Embedded analytics and white label BI solutions, tailored for your needs.

Embedded BI
 
NEW
IoT

Build, deploy, and scale IoT solutions for connected businesses.

IoT
 
DataPrep

AI-powered data preparation service for your data-driven organization.

DataPrep

IoT

 
NEW
IoT

Low-code IoT platform and solutions for connected businesses.

IoT

Search Result

 
CRM Plus

Unified platform to deliver top-notch customer experience.

Try now
CRM Plus
 
Service Plus

Unified platform for customer service and support teams.

Try now
Service Plus
 
Finance Plus

All-in-one suite to manage your operations and finances.

Try now
Finance Plus
 
People Plus

Comprehensive HR platform for seamless employee experiences.

Try now
People Plus
 
Workplace

Application suite built to improve team productivity and collaboration.

Try now
Workplace
 
Marketing Plus

Unified marketing platform for marketing teams.

Try now
Marketing Plus
 
All-in-one suite

Zoho One

The Operating System for Business

Run your entire business on Zoho with our unified cloud software, designed to help you break down silos between departments and increase organizational efficiency.

TRY ZOHO ONE
Zoho One
Zoho Marketplace

With over 2000 ready-to-use extensions across 40+ categories, connect your favorite business tools with the Zoho products you already use.

EXPLORE MARKETPLACE
Marketplace
Skip to main content

Python SDK Samples - Fields Operations

Get Fields (Metadata)
              
              
from zcrmsdk.src.com.zoho.crm.api.fields import *
from zcrmsdk.src.com.zoho.crm.api import ParameterMap
class Field(object):
    @staticmethod
    def get_fields(module_api_name):

        """
        This method is used to get metadata about all the fields of a module and print the response.
        :param module_api_name: The API Name of the module to get fields
        """

        """
        example
        module_api_name = "Leads";
        """

        # Get instance of FieldsOperations Class that takes module_api_name as parameter
        fields_operations = FieldsOperations(module_api_name)

        # Get instance of ParameterMap Class
        param_instance = ParameterMap()

        # Possible parameters for get_fields operation
        # param_instance.add(GetFieldsParam.type, "Unused")

        # Call get_fields method that takes paramInstance as parameter
        response = fields_operations.get_fields(param_instance)

        if response is not None:

            # Get the status code from response
            print('Status Code: ' + str(response.get_status_code()))

            if response.get_status_code() in [204, 304]:
                print('No Content' if response.get_status_code() == 204 else 'Not Modified')
                return

            # Get object from response
            response_object = response.get_object()

            if response_object is not None:

                # Check if expected ResponseWrapper instance is received
                if isinstance(response_object, ResponseWrapper):

                    # Get the list of obtained Field instances
                    fields_list = response_object.get_fields()

                    for field in fields_list:

                        # Get the ID of each Field
                        print('Field ID: ' + str(field.get_id()))

                        # Get the SystemMandatory of each Field
                        print("Field SystemMandatory: " + str(field.get_system_mandatory()))

                        # Get the Webhook of each Field
                        print("Field Webhook: " + str(field.get_webhook()))

                        # Get the JsonType of each Field
                        print("Field JsonType: " + str(field.get_json_type()))

                        # Get the private info of each field
                        private = field.get_private()

                        if private is not None:
                            # Get the type
                            print("Field Private Type: " + str(private.get_type()))

                            # Get the Export
                            print("Field Private Export: " + str(private.get_export()))

                            # Get the Restricted
                            print("Field Private Restricted: " + str(private.get_restricted()))

                        # Get the obtained Crypt instance
                        crypt = field.get_crypt()

                        if crypt is not None:
                            print("Crypt Details")

                            # Get the Crypt Mode
                            print("Mode: " + crypt.get_mode())

                            # Get the Crypt Column
                            print("Column: " + crypt.get_column())

                            # Get the Crypt Table
                            print("Table: " + crypt.get_table())

                            # Get the Crypt Status
                            print("Status: " + str(crypt.get_status()))

                        # Get the FieldLabel of each Field
                        print("Field FieldLabel: " + field.get_field_label())

                        tool_tip = field.get_tooltip()

                        if tool_tip is not None:
                            # Get the Name of the ToolTip
                            print("Field ToolTip Name: " + tool_tip.get_name())

                            # Get the Value of the ToolTip
                            print("Field ToolTip Value: " + tool_tip.get_value())

                        # Get the CreatedSource of each Field
                        print("Field CreatedSource: " + field.get_created_source())

                        # Get the FieldReadOnly of each Field
                        print("Field FieldReadOnly: " + str(field.get_field_read_only()))

                        # Get the DisplayLabel of each Field
                        print("Field DisplayLabel: " + field.get_display_label())

                        # Get the ReadOnly of each Field
                        print("Field ReadOnly: " + str(field.get_read_only()))

                        # Get the obtained AssociationDetails instance
                        association_details = field.get_association_details()

                        if association_details is not None:

                            # Get the obtained LookupField instance
                            lookup_field = association_details.get_lookup_field()

                            if lookup_field is not None:
                                # Get the ID of the LookupField
                                print("Field AssociationDetails LookupField ID: " + str(lookup_field.get_id()))

                                # Get the Name of the LookupField
                                print('Field AssociationDetails LookupField Name: ' + lookup_field.get_name())

                            # Get the obtained LookupField instance
                            related_field = association_details.get_related_field()

                            if related_field is not None:
                                # Get the ID of the RelatedField
                                print("Field AssociationDetails RelatedField ID: " + str(related_field.get_id()))

                                # Get the Name of the RelatedField
                                print('Field AssociationDetails RelatedField Name: ' + related_field.get_name())

                        if field.get_quick_sequence_number() is not None:
                            # Get the QuickSequenceNumber of each Field
                            print('Field QuickSequenceNumber: ' + str(field.get_quick_sequence_number()))

                        if field.get_businesscard_supported() is not None:
                            # Get the BusinesscardSupported of each Field
                            print('Field BusinesscardSupported: ' + str(field.get_businesscard_supported()))

                        # Check if MultiModuleLookup is not None
                        if field.get_multi_module_lookup() is not None:
                            # Get the MultiModuleLookup dict
                            for key, value in field.get_multi_module_lookup().items():
                                print(key + " : " + value)

                        # Get the obtained Currency instance
                        currency = field.get_currency()

                        if currency is not None:
                            # Get the RoundingOption of the Currency
                            print("Field Currency RoundingOption: " + str(currency.get_rounding_option()))

                            if currency.get_precision() is not None:
                                # Get the Precision of the Currency
                                print("Field Currency Precision: " + str(currency.get_precision()))

                        if field.get_custom_field() is not None:
                            # Get if the Field is a CustomField
                            print("Field CustomField: " + str(field.get_custom_field()))

                        lookup = field.get_lookup()

                        if lookup is not None:
                            # Get the obtained Layout instance
                            layout = lookup.get_layout()

                            # Check if layout is not null
                            if layout is not None:
                                # Get the ID of the Layout
                                print("Field ModuleLookup Layout ID: " + str(layout.get_id()))

                                # Get the Name of the Layout
                                print("Field ModuleLookup Layout Name: " + layout.get_name())

                            # Get the DisplayLabel of the Module
                            print("Field ModuleLookup DisplayLabel: " + str(lookup.get_display_label()))

                            # Get the APIName of the Module
                            print("Field ModuleLookup APIName: " + str(lookup.get_api_name()))

                            # Get the Module of the ModuleLookup
                            print("Field ModuleLookup Module: " + str(lookup.get_module()))

                            if lookup.get_id() is not None:
                                # Get the ID of the Module
                                print("Field ModuleLookup ID: " + str(lookup.get_id()))

                        if field.get_visible() is not None:
                            # Get the Visible of each Field
                            print("Field Visible: " + str(field.get_visible()))

                        if field.get_length() is not None:
                            # Get the Length of each Field
                            print("Field Length: " + str(field.get_length()))

                        view_type = field.get_view_type()

                        if view_type is not None:
                            # Get the View of the ViewType
                            print("Field ViewType View: " + str(view_type.get_view()))

                            # Get the Edit of the ViewType
                            print("Field ViewType Edit: " + str(view_type.get_edit()))

                            # Get the Create of the ViewType
                            print("Field ViewType Create: " + str(view_type.get_create()))

                            # Get the QuickCreate of the ViewType
                            print("Field ViewType QuickCreate: " + str(view_type.get_quick_create()))

                        subform = field.get_subform()

                        if subform is not None:
                            # Get the obtained Layout instance
                            layout = subform.get_layout()

                            # Check if layout is not null
                            if layout is not None:
                                # Get the ID of the Layout
                                print("Field Subform Layout ID: " + str(layout.get_id()))

                                # Get the Name of the Layout
                                print("Field Subform Layout Name: " + layout.get_name())

                            # Get the DisplayLabel of the Module
                            print("Field Subform DisplayLabel: " + str(subform.get_display_label()))

                            # Get the APIName of the Module
                            print("Field Subform APIName: " + str(subform.get_api_name()))

                            # Get the Module of the ModuleLookup
                            print("Field Subform Module: " + str(subform.get_module()))

                            if subform.get_id() is not None:
                                # Get the ID of the Module
                                print("Field Subform ID: " + str(subform.get_id()))

                        # Get the APIName of each Field
                        print("Field APIName : " + field.get_api_name())

                        # Get the obtained Unique instance
                        unique = field.get_unique()

                        if unique is not None:
                            # Get the Casesensitive of the Unique
                            print("Field Unique Casesensitive : " + str(unique.get_casesensitive()))

                        if field.get_history_tracking() is not None:
                            # Get the HistoryTracking of each Field
                            print("Field HistoryTracking: " + str(field.get_history_tracking()))

                        # Get the DataType of each Field
                        print("Field DataType: " + field.get_data_type())

                        # Get the obtained Formula instance
                        formula = field.get_formula()

                        # Check if formula is not null
                        if formula is not None:
                            # Get the ReturnType of the Formula
                            print('Field Formula ReturnType : ' + str(formula.get_return_type()))

                            if formula.get_expression() is not None:
                                # Get the Expression of the Formula
                                print("Field Formula Expression : " + str(formula.get_expression()))

                        if field.get_decimal_place() is not None:
                            # Get the DecimalPlace of each Field
                            print("Field DecimalPlace: " + str(field.get_decimal_place()))

                        # Get the MassUpdate of each Field
                        print("Field MassUpdate: " + str(field.get_mass_update()))

                        if field.get_blueprint_supported() is not None:
                            # Get the BlueprintSupported of each Field
                            print("Field BlueprintSupported: " + str(field.get_blueprint_supported()))

                        multi_select_lookup = field.get_multiselectlookup()

                        # Check if multiSelectLookup is not None
                        if multi_select_lookup is not None:
                            # Get the DisplayValue of the MultiSelectLookup
                            print("Field MultiSelectLookup DisplayLabel: " + str(multi_select_lookup.get_display_label()))

                            # Get the LinkingModule of the MultiSelectLookup
                            print("Field MultiSelectLookup LinkingModule: " + str(multi_select_lookup.get_linking_module()))

                            # Get the LookupApiname of the MultiSelectLookup
                            print("Field MultiSelectLookup LookupApiname: " + str(multi_select_lookup.get_lookup_apiname()))

                            # Get the APIName of the MultiSelectLookup
                            print("Field MultiSelectLookup APIName: " + str(multi_select_lookup.get_api_name()))

                            # Get the ConnectedlookupApiname of the MultiSelectLookup
                            print("Field MultiSelectLookup ConnectedlookupApiname: " + str(multi_select_lookup.get_connectedlookup_apiname()))

                            # Get the ID of the MultiSelectLookup
                            print("Field MultiSelectLookup ID: " + str(multi_select_lookup.get_id()))

                        pick_list_values = field.get_pick_list_values()

                        if pick_list_values is not None:
                            for pick_list_value in pick_list_values:

                                # Get the DisplayValue of each PickListValue
                                print("Field PickListValue DisplayValue: " + pick_list_value.get_display_value())

                                if pick_list_value.get_sequence_number() is not None:
                                    # Get the SequenceNumber of each PickListValue
                                    print("Field PickListValue SequenceNumber: " + str(pick_list_value.get_sequence_number()))

                                # Get the ExpectedDataType of each PickListValue
                                print("Field PickListValue ExpectedDataType: " + str(pick_list_value.get_expected_data_type()))

                                # Get the ActualValue of each PickListValue
                                print("Field PickListValue ActualValue: " + pick_list_value.get_actual_value())

                                if pick_list_value.get_maps() is not None:
                                    # Get each value from the map
                                    for map in pick_list_value.get_maps():
                                        print(map)

                                # Get the SysRefName of each PickListValues
                                print("Field PickListValue SysRefName: " + str(pick_list_value.get_sys_ref_name()))

                                # Get the Type of each PickListValues
                                print("Field PickListValue Type: " + str(pick_list_value.get_type()))

                        auto_number = field.get_auto_number()

                        # Check if autoNumber is not None
                        if auto_number is not None:
                            # Get the Prefix of the AutoNumber
                            print('Prefix: ' + str(auto_number.get_prefix()))

                            # Get the Suffix of the AutoNumber
                            print('Suffix: ' + str(auto_number.get_suffix()))

                            if auto_number.get_start_number() is not None:
                                # Get the StartNumber of the AutoNumber
                                print('Start Number: ' + str(auto_number.get_start_number()))

                        if field.get_default_value() is not None:
                            # Get the DefaultValue of each Field
                            print("Field DefaultValue: " + str(field.get_default_value()))

                        if field.get_section_id() is not None:
                            # Get the SectionId of each Field
                            print("Field SectionId: " + str(field.get_section_id()))

                        # Check if ValidationRule is not None
                        if field.get_validation_rule() is not None:
                            # Get the validationRule dict
                            for key, value in field.get_validation_rule().items():
                                print(key + " : " + value)

                        # Check if ConvertMapping is not None
                        if field.get_convert_mapping() is not None:
                            # Get the ConvertMapping dict
                            for key, value in field.get_convert_mapping().items():
                                print(key + " : " + str(value))

                # Check if the request returned an exception
                elif isinstance(response_object, APIException):

                    # Get the Status
                    print("Status: " + response_object.get_status().get_value())

                    # Get the Code
                    print("Code: " + response_object.get_code().get_value())

                    print("Details")

                    # Get the details dict
                    details = response_object.get_details()

                    for key, value in details.items():
                        print(key + ' : ' + str(value))

                    # Get the Message
                    print("Message: " + response_object.get_message().get_value())
 
Get Field (Metadata)