This guide will help you with the following:
- Text
- Number
- Decimal
- Boolean
- Data-time
- Time
- List
- Key-value
Text data type
The text, or string, datatype represents a sequence of characters. These characters can be text characters, special characters, numeric characters, or other valid input, and must be enclosed in double quotes.
Note: The backslash ( \ ) can be used to escape double quotes within a string
Example
- Name = "John";
- Address = "Zoho Corporation, 4141 Hacienda Drive, Pleasanton, California 94588, USA";
- Num = "1234567890";
Number data type
The Number datatype represents integer values. These integer values can range from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,808. Number datatype does not include decimal values. However, Number datatype can be used to perform operations with decimal values, in which case the end result becomes a decimal datatype.
Example
Decimal data type
The decimal datatype represents decimal values, commonly used to represent values such as currency, percentage, etc.
Example
Boolean
The boolean datatype represents the boolean values - true and false.
Note:
- Boolean values must not be enclosed in quotes
- Boolean values are case-insensitive
Example
- job_experience = false;
- Salary_negotiable = true;
Data-Time data type
The date-time datatype represents date and time values in a variety of supported formats.
Note:
- Date-time values must be enclosed within single quotes.
- A date can be declared without time, in which case 00:00:00 is taken as the default.
Example
- date = '15-Aug-1947';
- appointment_time = '15-Aug-1947 19:00:00';
- dd-MMM-yy (15-Aug-47)
- dd-MMM-yyyy (15-Aug-1947)
- dd-MMMM-yy (15-August-47)
- dd-MMMM-yyyy (15-August-1947)
- MM-dd-yy (08-15-47)
- yy-MM-dd (47-08-15)
- dd-MM-yy (15-08-47)
- dd-MM-yyyy (15-08-1947)
- MM-dd-yyyy (08-15-1947)
- yyyy-MM-dd (1947-08-15)
- yy/MM/dd (47/08/15)
- dd/MM/yy (15/08/47)
- MM/dd/yy (08/15/47)
- yyyy/MM/dd (1947/08/15)
- MM/dd/yyyy (08/15/1947)
- dd/MM/yyyy (15/08/1947)
- dd MMM,yy (15 Aug,47)
- MMM dd,yy (Aug 15,47)
- dd MMM,yyyy (15 Aug,1947)
- MMM dd,yyyy (Aug 15,1947)
- dd MMMM,yy (15 August,47)
- MMMM dd,yy (August 15,47)
- dd MMMM,yyyy (15 August,1947)
- MMMM dd,yyyy (August 15,1947)
- E,MMMM dd,yyyy (Fri,August 15,1947)
- E,MMM dd,yyyy (Fri,Aug 15,1947)
- MMM dd yy (Aug 15 47)
- dd MMM yy (15 Aug 47)
- MMM dd yyyy (Aug 15 1947)
- dd MMM yyyy (15 Aug 1947)
- MMMM dd yy (August 15 47)
- dd MMMM yy (15 August 47)
- dd MMMM yyyy (15 August 1947)
- MMMM dd yyyy (August 15 1947)
- dd.MM.yy (15.08.47)
- MM.dd.yy (08.15.47)
- yy.MM.dd (47.08.15)
- dd MM yyyy (15 08 1947)
- dd.MM.yyyy (15.08.1947)
- MM.dd.yyyy (08.15.1947)
- yyyy.MM.dd (1947.08.15)
Note: In the event of mismatch between the specified and supported Date Time formats, we will try to convert the specified format into the closest supported format. In the event of a failure, an error message will be encountered.
Time data type
The time datatype represents time values in both 12-hour and 24-hour formats. This data type works independently of a date value.
Note:
- Time data type is currently supported only in Zoho Creator.
- Time values must be enclosed within single quotes.
- Time values range between '12:00:00 AM' to '11:59:59 PM' for 12-hour format.
- Time values range between '00:00:00' to '23:59:59' for 24-hour format.
- A time value should be defined with all the three components - hours, minutes and seconds in place (AM/PM in case of 12-hour format).
Example
- available_from = '19:00:00';
- closing_at = '06:00:00 PM';
- hh:mm:ss a (12-hour format)
- HH:mm:ss (24-hour format)
Note:
- Declared time values cannot skip either the seconds part or seconds and minutes parts altogether. In the event the value does not conform to the supported time formats, an error message will be thrown.
- However time values without the seconds (hh:mm or HH:mm) or without the minutes and seconds (hh or HH) part assigned to TIME fields will be accepted by defaulting the missing components. For example, "10 AM" assigned to a TIME field will be treated as '10:00:00 AM' and "18:15" will be treated as "18:15:00".
- Care should be exercised while declaring a value like "15 minutes and 12 seconds". Declaring this value as "15:12" would be read as "15:12:00". It should be declared as "00:15:12" and "10 seconds" should be declared like "00:00:10".
- TIME values in no way should fall outside the 24 hour range. A value declared like "23:59:60" would throw an error.
- Operations (like addHour, subMinutes) on TIME values which result in a value outside the 24-hour range will also result in an error
List data type
List is a data-type which can hold a collection of values. Each value present in the list is called an element.
A list can contain elements of different types say number, text, date etc. grouped together. You can also restrict the list to only accept values of a specific data-type using special qualifiers. In general, a list provides methods to store, retrieve and manipulate an aggregate of elements.
Example
- ZohoProducts = {"Creator", "CRM", "Projects", "Campaigns"};
Elements in a list can be subject to various operations such as:
- Positional Access - Manipulate elements based on their numerical positional in the list. For example, functions such as contains(), get(), and remove().
- Search - Search for elements in a list and return their numeric position. For example functions like indexOf(), lastIndexOf().
- Range - Perform range operations like sublist().
- Unique functions - Perform unique functions like intersect(), sort(), etc.
Key-Value data type
Key-Value is a data-type which holds values based on keys. The keys can be used to retrieve the corresponding values. Keys must be unique. If the same key is specified again, its value will overwrite the first value. Both, keys and values can be of any data type.
Example
- ZohoProduct = {"Product" : "Creator", "Version" : 5};
The key value pairs can be subject to various operations such as:
- Key-value pair operations - Perform actions based on the key-value pair. For example, functions such as put(), get() and putAll()
- Search - Search for key or value return a boolean value. For example, functions such as containKey() and containValue().
- Range - Perform range operations to return all the keys. For example, keys().
- Unique functions - Perform unique functions like size() to return the size of the key-value pairs.