text Functions
Returns 'true' if the specified substring is present in the given string
<text1>.contains(<text2>);
info "Zoho Creator".contains("Zoho"); /// Returns: true
functionId tryout-exampleproduct_name="Zoho Creator"; org_name="Zoho"; info product_name.contains(org_name);
Returns 'true' if the main text includes the specified text. Otherwise it will return 'false'
<text1>.contains(<text2>);
Here main text "ZohoCreator" contains the specific text "Zoho" so it returns true. Otherwise it will return false.
Returns true if sourcestring starts with searchstring.
<text1>.startsWith(<text2>);
info "ZohoCreator".startsWith("Zoho"); /// Returns: true
functionId tryout-exampleproduct_name="Zoho Creator"; result = product_name.startsWith("Zoho"); info result;
Returns 'true' if the given text starts with specified text. Otherwise it will return 'false'.
<text1>.startsWith(<text2>);
Here text "Zoho Creator" starts with "Zoho", hence it returns true. Otherwise it will return 'false'.
Returns true if sourcestring ends with searchstring.
<text1>.endsWith(<text2>);
info "Zoho Creator".endsWith("Creator"); /// Returns: true
functionId tryout-exampleproduct_name="Zoho Creator"; org_name="Creator"; info product_name.endsWith(org_name);
Returns 'true' if the specified text is at the end of the main text. Otherwise it will return 'false'.
<text1>.endsWith(<text2>);
Here the specified text "Creator" is at the end of the main text "Zoho Creator", hence it returns true. Otherwise it will return false.
Returns true if string1 equals string2.
<text1>.equalsIgnoreCase(<text2>);
info "Hello World!".equalsIgnoreCase("hello world!"); /// Returns: true
functionId tryout-exampleproduct_name="Zoho Creator"; org_name="zoho creator"; info product_name.equalsIgnoreCase(org_name);
Returns 'true' if the main text is equal to the specified text. Otherwise it will return 'false'.
<text1>.equalsIgnoreCase(<text2>);
Here main text "Zoho Creator" is equal to specified text "zoho creator" as case sensitivity is ignored, hence it will return 'true'. Otherwise it will return 'false'.
Returns true if sourcestring matches specified regex pattern.
<text>.matches(<regex>);
info "ID004500F".matches("[A-Z]{2}[0-9]{6}[A-Z]"); /// Returns: true
functionId tryout-exampleusername="ZC000001APP"; result = username.matches("[A-Z]{2}[0-9]{6}[A-Z]{3}"); info result;
Returns 'true' if given text matches with the regular expression. Otherwise it will return 'false'.
<text>.matches(<regex>);
Here username consist of first '2' letters as alphabets followed by '6' digits and '3' alphabets. Regular expression satisfies the same criteria, hence it will return 'true'. Otherwise it will return 'false'.
Returns only alphabets present in the string.
<text>.getAlpha();
result = "1-Red,2-Green,3-Blue".getAlpha(); info result; /// Returns: "RedGreenBlue"
functionId tryout-exampleform_name="Form-1,Form-2,Form-3"; info form_name.getAlpha();
Returns only alphabets from the given text and ignores the rest. Returns the empty text if alphabets are not found in given text.
<text>.getAlpha();
Here text "Form-1,Form-2,Form-3" contains alphabets(words) "Form", Numbers(1,2,3) and special characters('-'&','), hence it will return "FormFormForm". Otherwise it will return empty string.
Returns only the alphanumeric characters present in the specified string.
<text>.getAlphaNumeric();
result = "1-Red,2-Green,3-Blue".getAlphaNumeric(); info result; /// Returns: "1Red2Green3Blue"
functionId tryout-exampleform_name="Form-1,Form-2,Form-3"; info form_name.getAlphaNumeric();
Returns alphabets and numbers from the given text and ignores the rest. Returns empty text if alphabets and numbers are not found in given text.
<text>.getAlphaNumeric();
Here text "Form-1,Form-2,Form-3" contains alphabets(words) "Form", Numbers(1,2,3) and special characters('-'&','), hence it will return "Form1Form2Form3". Otherwise it will return empty text.
Returns the number of times a substring is present in the given string.
<text1>.getOccurenceCount(<text2>);
result = "You are a very very nice person".getOccurenceCount("very"); info result; /// Returns: 2
functionId tryout-examplestatement = "Zoho Creator is a Zoho Product"; result = statement.getOccurenceCount("Zoho"); info result;
Returns a value which represents number of times the substring (word/alphabet) has occurred. Returns '0' if the substring is not present.
<text1>.getOccurenceCount(<text2>);
Here in the sentence the word "Zoho" occurred 2 times hence the answer is '2'. Otherwise it will return '0'.
Returns the string before the specified substring.
<text1>.getPrefix(<text2>);
result = "One Two Three".getPrefix("Two"); info result; /// Returns: "One "
functionId tryout-exampleproduct_name="Zoho Creator"; result = product_name.getPrefix("Creator"); info result;
Returns the text which is present before the mentioned text. If no prefix is found, the function will return an empty text. If the subtext is not found in the source text, the function will return null.
<text1>.getPrefix(<text2>);
In the source text - "Zoho Creator", the prefix of subtext - "Creator" is "Zoho ". Hence, it will return "Zoho ".
Returns the string after the specified substring.
<text1>.getSuffix(<text2>);
result = "One Two Three".getSuffix("Two"); info result; /// Returns: " Three"
functionId tryout-exampleproduct_name="Zoho Creator"; result = product_name.getSuffix("Zoho"); info result;
Returns the text which is present after the mentioned text. If no suffix is found, the function will return an empty text. If the subtext is not found in the source text, the function will return null.
<text1>.getSuffix(<text2>);
Here " Creator" is suffix of "Zoho" as it occurs right after "Zoho", hence it will return " Creator". If no suffix is found then it will return an empty string.
Returns the position of the given substring in the string (first character's position is '0')
<text1>.indexOf(<text2>);
result = "Red ,Green ,Blue".indexOf("Green"); info result; /// Returns: 5
functionId tryout-exampleproduct_name="Zoho Creator"; result = product_name.indexOf("Creator"); info result;
Returns the position of the given substring in main text. Otherwise it will return '-1' if text is not found.
<text1>.indexOf(<text2>);
Here the text "Zoho Creator" has substring "Creator" on 5th position (starting from '0'), hence it returns 5. A substring can be a word or alphabet. Returns '-1' if word/alphabet is not found.
Returns the position of the last occurence of the substring in the string.
<text1>.lastIndexOf(<text2>);
result = "Red ,Green ,Green".lastIndexOf("Green"); info result; /// Returns: 12
functionId tryout-exampleproduct_name="Zoho Creator Creator"; result = product_name.lastIndexOf("Creator"); info result;
Returns the position of last occurence of mentioned substring in main text. Returns '-1' if subtext is not found.
<text1>.lastIndexOf(<text2>);
Here the text "Zoho Creator Creator" contains text "Creator" two times having '5' and '13' as their positions, hence it returns '13' as last index. Returns '-1' if text is not found.
Removes and returns the specified substring present in the string
<text1>.remove(<text2>);
info "Red ,Green ,Green".remove("Green"); /// Returns: "Red , ,"
functionId tryout-exampleproduct_name="Zoho Creator Zoho Creator"; result = product_name.remove("Creator"); info result;
Removes the specified text and returns the edited text. The original text remains unaffected. Returns unchanged text if the specified text is not found.
<text1>.remove(<text2>);
Here the text "Zoho Creator Zoho Creator" contains "Creator" two times hence all occurences of "Creator" has been removed from the text. If specified text is not found then it will return the original string.
Removes all the alphabets present in the specified string.
<text>.removeAllAlpha();
info "1-Red,2-Grean,3-Blue".removeAllAlpha(); /// Returns: "1-,2-,3-"
functionId tryout-exampleproduct_name = "I have 12-Zoho Creator Applications"; result = product_name.removeAllAlpha(); info result;
Removes all alphabets from the given text and returns the edited text. If the source text doesn't have numbers or special characters, the function returns an empty text. If the source text doesn't have letters, the function returns the unchanged text.
<text>.removeAllAlpha();
Here the text "I have 12-Zoho Creator Applications" contains '12' as numeric value, "-" as special character and remaining text has alphabets hence all alphabets are removed and '12-' is returned. Returns nothing if there are no numbers or special characters.
Remove all the alphanumeric characters present in the specified string.
<text>.removeAllAlphaNumeric();
info "1-Red,2-Grean,3-Blue".removeAllAlphaNumeric(); /// Returns: "-,-,-"
functionId tryout-exampleproduct_name = "I have 12-Zoho Creator Applications"; result = product_name.removeAllAlphaNumeric(); info result;
Removes all alphabets and numbers from the given text and returns the edited text. If the source text doesn't have special characters, the function returns an empty text. If the source text doesn't have letters or numbers, the function returns the unchanged text.
<text>.removeAllAlphaNumeric();
Here the text "I have 12-Zoho Creator Applications" contains '12' as numeric value, "-" as special character and remaining text has alphabets hence all alphabets and numbers are removed and '-' is returned. Returns nothing if there are no special characters.
Removes the first occurence of the substring from the given string..
<text1>.removeFirstOccurence(<text2>);
info "Red ,Green ,Green".removeFirstOccurence("Green"); /// Returns: "Red , ,Green"
functionId tryout-exampleproduct_name="Zoho Creator Zoho Creator"; result = product_name.removeFirstOccurence("Creator"); info result;
Removes first occurence of the specified text and returns the edited text. Returns unchanged text if the specified text is not found.
<text1>.removeFirstOccurence(<text2>);
Here the text "Zoho Creator Zoho Creator" contains "Creator" two times hence first occurence of "Creator" will be removed from the text. If specified text is not found then original string will be returned.
Removes the last occurence of the substring from the string.
<text1>.removeLastOccurence(<text2>);
info "Red ,Green ,Green".removeLastOccurence("Green"); /// Returns: "Red ,Green ,"
functionId tryout-exampleproduct_name="Zoho Creator Zoho Creator"; result = product_name.removeLastOccurence("Creator"); info result;
Removes last occurence of the specified text and returns the edited text. Returns unchanged text if the specified text is not found.
<text1>.removeLastOccurence(<text2>);
Here the text "Zoho Creator Zoho Creator" contains "Creator" two times hence last occurence of "Creator" will be removed from the text. If specified text is not found then original string will be returned.
Replaces all Occurence of the string that matches the given <searchString> expression with the given <replacementString>.
<text1>.replaceAll(<text2>,<text3>,<true/false>);
info "Red ,Green ,Green".replaceAll("Green","Blue"); /// Returns: "Red ,Blue ,Blue"
functionId tryout-example/*Example 1*/
product_name="Zoho Creator Zoho Creator";
result = product_name.replaceAll("Creator","CRM");
info result;
// returns Zoho CRM Zoho CRM
/*Example 2*/
email_id = "shawn24@zylker.com";
result1 = email_id.replaceAll("(.*)@([a-z]*).com","
Replaces all the occurrence of given text (
<text1>.replaceAll(<text2>,<text3>,<true/false>);
Example 1: The text "Zoho Creator Zoho Creator" contains "Creator" two times. Hence, all the occurrences of "Creator" will be replaced by "CRM".
Example 2: This example searches for the regex pattern specified in the first param and replaces all of its occurrences with the second param, if found. Hence, it returns "
Example 3: It returns the source text as such. This is because the third parameter is set to true. So, even though the regex pattern is found, it is not considered as a match.
Replaces the first Occurence of the string that matches the given searchString expression with the given replacementString
<text1>.replaceFirst(<text2>,<text3>,<true/false>);
info "Red ,Green ,Green".replaceFirst("Green","Blue"); /// Returns: "Red ,Blue ,Green"
functionId tryout-example/*Example 1*/
product_name="Zoho Creator Zoho Creator";
result = product_name.replaceFirst("Creator","CRM");
info result;
// returns Zoho CRM Zoho Creator
/*Example 2*/
email_id = "shawn24@zylker.com";
result1 = email_id.replaceFirst("(.*)@([a-z]*).com","
Replaces the first occurrence of given text (
<text1>.replaceFirst(<text2>,<text3>,<true/false>);
Example 1: The text "Zoho Creator Zoho Creator" contains "Creator" two times,
and only the first occurrence of "Creator" will be replaced by "CRM". Hence, it returns "Zoho CRM Zoho Creator".
Example 2: This example searches for the first occurrence of the regex pattern specified in the first param and replaces it with the second param, if found. Hence, it returns "
Example 3: It returns the source text as such. This is because the third parameter is set to true. So, even though the regex pattern is found, it is not considered as a match.
Convert the string to lowercase.
<text>.toLowerCase();
info "ZohoCreator".toLowerCase(); /// Returns: "zohocreator"
functionId tryout-exampleproduct_name="ZOHO CREATOR"; result = product_name.toLowerCase(); info result;
Replaces all uppercase alphabets to lowercase and return the updated text. If no uppercase alphabets are present then unchanged text is returned.
<text>.toLowerCase();
Here the text "ZOHO CREATOR" is in uppercase which will be converted to lowercase, hence it will return "zoho creator". If no uppercase alphabets are present then unchanged text is returned.
Convert the string to uppercase.
<text>.toUpperCase();
info "ZohoCreator".toUpperCase(); /// Returns: "ZOHOCREATOR"
functionId tryout-exampleproduct_name="Zoho Creator"; result = product_name.toUpperCase(); info result;
Replaces all lowercase alphabets to uppercase and return the updated text. If no lowercase alphabets are present then unchanged text is returned.
<text>.toUpperCase();
Here the text "Zoho Creator" contains both uppercase and lowercase alphabets which will be converted to uppercase, hence it will return "ZOHO CREATOR". If no lowercase alphabets are present then unchanged text is returned.
Convert the string to uppercase.
<text>.upper();
info "ZohoCreator".upper(); /// Returns: "ZOHOCREATOR"
functionId tryout-exampleproduct_name="Zoho Creator"; result = product_name.upper(); info result;
Replaces all lowercase alphabets to uppercase and return the updated text. If no lowercase alphabets are present then unchanged text is returned.
<text>.upper();
Here the text "Zoho Creator" contains both uppercase and lowercase alphabets which will be converted to uppercase, hence it will return "ZOHO CREATOR". If no lowercase alphabets are present then unchanged text is returned.
Convert the string to lowercase.
<text>.lower();
info "ZohoCreator".lower(); /// Returns: "zohocreator"
functionId tryout-exampleproduct_name="ZOHO CREATOR"; result = product_name.lower(); info result;
Replaces all uppercase alphabets to lowercase and returns the updated text. If no uppercase alphabets are present then unchanged text is returned.
<text>.lower();
Here the text "ZOHO CREATOR" is in uppercase which will be converted to lowercase, hence it will return "zoho creator". If no uppercase alphabets are present then unchanged text is returned.
Removes any leading and trailing whitespace from a string
<text>.trim();
info " Welcome to Zoho Creator ".trim();/// Returns: "Welcome to Zoho Creator"
functionId tryout-exampleproduct_name=" Zoho Creator "; result = product_name.trim(); info result;
Returns a new text with all the unnecessary leading and trailing whitespaces from the source text removed. If no such whitespaces are present, an unchanged copy of the source text is returned.
<text>.trim();
Here, the source text - " Zoho Creator " has unnecessary leading and trailing whitespaces. The trim() function removes these spaces and returns "Zoho Creator".
Returns the string from the specified startindex to the endindex.
<text>.subString(<startIndex>,<endIndex>);
info "ZohoCreator".subString(0,4); /// Returns: "Zoho"
functionId tryout-exampleproduct_name="Zoho Creator"; result = product_name.subString(0,4); info result;
Returns part of text with mentioned range from startIndex (inclusive) to endIndex (exclusive). Returns nothing if startIndex is equal to endIndex'.
<text>.subString(<startIndex>,<endIndex>);
Here 'product_name.subString(0,4)' will return text from position '0' to '4', hence it returns "Zoho". Returns nothing if startIndex is equal to endIndex'.
Returns the 'String' value for the specified hexadecimal value
<text>.hexToText();
info "6174656ec383c2a7c383c2a36f20 ".hexToText();/// Returns: "atenção"
functionId tryout-exampleresponse = hexToText("5a796c6b657220436f7270"); info response; // Returns Zylker Corp
Takes a hexadecimal value as input and returns its equivalent text.
<text>.hexToText();
The hexToText() function converts the given hexadecimal into a text. In the example presented, the hexadecimal supplied as input value is "5a796c6b657220436f7270". Hence, it returns "Zylker Corp" which is the text equivalent of the input.
Returns the 'Hex' value for the specified string value
<text>.textToHex();
info "atenção ".textToHex();/// Returns: "6174656ec383c2a7c383c2a36f20"
functionId tryout-exampleresponse = textToHex("Zylker Corp"); info response; // Returns 5a796c6b657220436f7270
Takes a text as input and returns its equivalent hexadecimal value.
<text>.textToHex();
The textToHex() function converts the given text into a hexadecimal value. In the example presented, the text supplied as input value is "Zylker Corp". Hence, it returns "5a796c6b657220436f7270" which is the hexadecimal equivalent of the input.
Returns the string from the specified startindex to the endindex.
<text>.subText(<number>,<number>);
info "ZohoCreator".subText(0,4); /// Returns: "Zoho"
functionId tryout-exampleproduct_name="Zoho Creator"; result = product_name.subText(0,4); info result;
Returns part of text with mentioned range from startIndex (inclusive) to endIndex (exclusive). Returns nothing if startIndex is equal to endIndex'.
<text>.subText(<number>,<number>);
Here 'product_name.subText(0,4)' will return text from position '0' to '4', hence it returns "Zoho". Returns nothing if startIndex is equal to endIndex'.
Returns the specified number of characters from the left of the source text
<text>.left(<number>);
info "Pad me".left(3); /// Returns: "Pad"
functionId tryout-exampleproduct_name="Zoho Creator"; info product_name.left(4);
Returns the piece of text specified by the number of characters starting from the left
<text>.left(<number>);
Here, the left() function extracts the left most 4 characters from the given text. Hence, it returns 'Zoho'.
Returns the Map from given JSON formatted String
<text1>.toCollection(<text2>);
info "read write speak".toCollection(" "); /// Returns: {"read","write","speak"}
functionId tryout-exampleproduct_name="Zoho Creator Application"; result = product_name.toCollection(" "); info result;
If the given text is in the form of list then it splits the text by the given subtext and converts them into list . If given subtext is not present, then it will return the unchanged text in the list. If it is in the form of map, then the text is converted into map
<text1>.toCollection(<text2>);
Here 'toCollection(" ")' function will convert the text to list or map
Returns the specified number of characters from the right of the source text
<text>.right(<number>);
info "Pad me".right(3); /// Returns: " me"
functionId tryout-exampleproduct_name="Zoho Creator"; info product_name.right(7);
Returns the piece of text specified by the number of characters starting from the right.
<text>.right(<number>);
Here, the right() function extracts the right most 7 characters from the given text. Hence, it returns 'Creator'.
Capitalizes the first letter after every space, in a specified string, leaving all other letters in lowercase
<text>.proper();
info "Create online database applications".proper(); /// Returns: "Create Online Database Applications"
functionId tryout-exampleproduct_name="welcome to zoho creator!"; info product_name.proper();
Returns the text after converting first alphabet of each word of the sentence in uppercase.
<text>.proper();
Here 'Proper()' function converts first alphabet of every word in the sentence 'welcome to zoho creator!' to uppercase, hence it returns "Welcome To Zoho Creator!". If first alphabet of a word is already in uppercase then no changes are made in that word.
Returns 'True' if specified first string contains specified second string irrespective of uppercase/lowercase, else returns 'false'.
<text1>.containsIgnoreCase(<text2>);
info "RED,GREEN,BLUE".containsIgnoreCase("Blue"); /// Returns: true
functionId tryout-exampleapp_name="ZOHO CREATOR APPLICATION"; info app_name.containsIgnoreCase("Application");
Returns 'true' if the mentioned text is found in main text irrespective of uppercase/lowercase. Otherwise it will return false.
<text1>.containsIgnoreCase(<text2>);
Here the text contains the word "Application" in main text "ZOHO CREATOR APPLICATION" irrespective of uppercase/lowercase, hence it returns 'true'. Otherwise it will return 'false'.
Returns 'True' if specified first string does not contain specified second string, else returns 'false', while the search performed is strictly case-sensitive.
<text1>.notContains(<text2>);
info "RED,GREEN,BLUE".notContains("YELLOW"); /// Returns: true
functionId tryout-exampleapp_name="ZOHO CREATOR APPLICATION"; info app_name.notContains("APPLICATION");
Returns 'true' if the mentioned text is not found in main text . Otherwise it will return false.
<text1>.notContains(<text2>);
Here the text does not contain the word "APPLICATION" in main text "ZOHO CREATOR", hence it returns 'true'. Otherwise it will return 'false'. This search is strictly case-sensitive.
Returns the first occurence position of the specified value in a string
<text1>.find(<text2>);
text="Hello, world".find("world"); info text; /// Returns: 7
functionId tryout-exampleproduct_name="Zoho Creator Application"; info product_name.find("Creator");
Returns the starting index of first occurence of the mentioned text in main text.
<text1>.find(<text2>);
Here 'Find()' function finds the first occurence of the mentioned string "Creator" and returns the start index of the same in given text "Zoho Creator Application", hence it returns '5'. Returns '-1' if the text is not found.
Returns the input string with whitespace characters padded to the left of the string.
<text>.leftPad(<number>);
info "Pad me".leftPad(10); /// Returns: " Pad me"
functionId tryout-exampleproduct_name="Zoho Creator"; info product_name.leftPad(15);
Returns the given text after adding whitespace characters to its left so that the total size of string matches the specified number.
<text>.leftPad(<number>);
Here 'leftPad()' is expected to produce a text of length 15 characters. The original text being 12 characters, leftPad() pads 3 whitespaces to the left making it 15 characters.
Returns the string from the specified startindex to the endindex.
<text>.mid(<number>,<number>);
info "Hello world, welcome to the Universe".mid(6,11); /// Returns: "world"
functionId tryout-exampleapp_name="Zoho Creator Application"; info app_name.mid(5,12);
Returns the part of given text from mentioned index range.
<text>.mid(<number>,<number>);
Here 'mid()' function returns the part of given text "Zoho Creator Application" from mentioned index range '(5,12)' with indexes 5 and 12 inclusive. Hence, it returns "Creator". Index range should not exceed the given text length.
Returns the input string with whitespace characters padded to the right of the string.
<text>.rightPad(<number>);
info "Pad me".rightPad(10); /// Returns: "Pad me "
functionId tryout-exampleproduct_name="Zoho Creator"; info product_name.rightPad(15);
Returns the given text after adding whitespace characters to its right so that the total size of string matches the specified number.
<text>.rightPad(<number>);
Here 'rightPad()' is expected to produce a text of length 15 characters. The original text being 12 characters, rightPad() pads 3 whitespaces to the right making it 15 characters.
Returns 'True' if the specified first string starts with the specified second string irrespective of uppercase/lowercase, else returns 'false'.
<text1>.startsWithIgnoreCase(<text2>);
info "ZohoCreator".startsWithIgnoreCase("zoho"); /// Returns: true
functionId tryout-exampleproduct_name="Creator Application"; result = product_name.startsWithignorecase("Creator"); info result;
Returns 'true' if the given text starts with specified text. Otherwise it will return 'false'. The search is irrespective of uppercase/lowercase.
<text1>.startsWithIgnoreCase(<text2>);
Here text "Creator Application" starts with "Creator", hence it returns true. Otherwise it will return 'false'. The search is irrespective of uppercase/lowercase.
Returns 'True' if the specified first string ends with the specified second string irrespective of uppercase/lowercase, else returns 'false'.
<text1>.endsWithIgnoreCase(<text2>);
info "ZohoCreator".endsWithIgnoreCase("creator"); /// Returns: true
functionId tryout-exampleproduct_name="Creator Application"; result = product_name.endsWithIgnoreCase("Application"); info result;
Returns 'true' if the given text ends with specified text. Otherwise it will return 'false'. The search is irrespective of uppercase/lowercase.
<text1>.endsWithIgnoreCase(<text2>);
Here text "Creator Application" ends with "Creator", hence it returns true. Otherwise it will return 'false'. The search is irrespective of uppercase/lowercase.
Concatenate given strings
<text1>.concat(<text2>);
info "Zoho ".concat("Creator"); /// Returns: Zoho Creator
functionId tryout-exampleorg_name="Zoho "; service="Creator"; result = org_name.concat(service); info result;
Append/Concat a string to another string.
<text1>.concat(<text2>);
Two strings "Zoho" and "Creator" concatenated/appended and gives "Zoho Creator"
Compares and checks if the specified values are equal.
<value1>.equals(<value2>);
info "Zoho ".equals("zoho"); /// Returns: false
functionId tryout-exampleinfo '01/01/2017'.equals('01-Jan-2017');
Checks if the specified values (can be of any data type) are equal. It returns a boolean result: true if the values are the same, and false if they are not.
<value1>.equals(<value2>);
Here, the 'equals()' function parses the dates into a standard date object and compares the underlying date values, regardless of their format. Hence, it returns true.
number Functions
Returns the absolute value of a number
<number / decimal>.abs();
info -2.abs(); /// Returns: 2
functionId tryout-examplenumber=-3.45; info number.abs();
Returns the absolute value of given number by making it positive.
<number / decimal>.abs();
Here 'abs()' function returns the absolute value of given number, hence it returns '3.45'. A number can be positive, negative or in fraction.
Returns the trigonometric cosine of the given angle ( in radians )
<number / decimal>.cos();
info 45.cos(); /// Returns: 0.5253219888177297
functionId tryout-exampleangle = 1.0471975511965979; info angle.cos();
Returns the trigonometric cosine of the angle (in radians) specified by <number/decimal>.
<number / decimal>.cos();
The cos() function returns a number that represents the trigonometric cosine of the given angle. In the example presented, the specified angle is 1.0471975511965979 radians, i.e., (60°*pi)/180. Hence, it returns 0.5, as cos (60°) = 0.5.
Returns the trigonometric sine of the given angle ( in radians )
<number / decimal>.sin();
info 45.sin(); /// Returns: 0.8509035245341184
functionId tryout-exampleangle = 1.57079632679; info angle.sin();
Returns the trigonometric sine of the angle (in radians) specified by <number/decimal>.
<number / decimal>.sin();
The sin() function returns a number that represents the trigonometric sine of the given angle. In the example presented, the specified angle is 1.57079632679 radians, i.e., (90°*pi)/180. Hence, it returns 1.0, as sin (90°) = 1.
Returns the trigonometric tangent of the given angle ( in radians)
<number / decimal>.tan();
info 45.tan(); /// Returns: 1.6197751905438615
functionId tryout-exampleangle= 0.7853981633974483; info angle.tan();
Returns the trigonometric tangent of the angle (in radians) specified by <number/decimal>.
<number / decimal>.tan();
The tan() function returns a number that represents the trigonometric tangent of the given angle. In the example presented, the specified angle is 0.7853981633974483 radians, i.e., (45°*pi)/180. Hence, it returns 1, as tan (45°) = 1.
Returns the angle of the given trigonometric cosine ( in radians)
<number / decimal>.acos();
info 0.5.acos(); /// Returns: 1.0471975511965979
functionId tryout-examplevalue = 0.5; info value.acos();
Returns the angle (in radians) of the trigonometric cosine specified by <number/decimal>.
<number / decimal>.acos();
The acos() function returns a number that represents the angle(in radians) of the given trigonometric cosine. In the example presented, the specified trigonometric cosine is 0.5. Hence, it returns 1.0471975511965979 radians, i.e., (60°*pi)/180, as arccos (0.5) = 60°.
Returns the angle of the given trigonometric sine ( in radians)
<number / decimal>.asin();
info 0.5.asin(); /// Returns: 0.5235987755982989
functionId tryout-examplevalue = 1; info value.asin();
Returns the angle (in radians) of the trigonometric sine specified by <number/decimal>.
<number / decimal>.asin();
The asin() function returns a number that represents the angle(in radians) of the given trigonometric sine. In the example presented, the specified trigonometric sine is 1. Hence, it returns 1.57079632679 radians, i.e., (90°*pi)/180, as arcsin (1) = 90°.
Returns the angle of the given trigonometric tangent ( in radians)
<number / decimal>.atan();
info 45.atan(); /// Returns: 1.5485777614681775
functionId tryout-examplevalue = 1; info value.atan();
Returns the angle (in radians) of the trigonometric tangent specified by <number/decimal>.
<number / decimal>.atan();
The atan() function returns a number that represents the angle(in radians) of the given trigonometric tangent. In the example presented, the specified trigonometric tangent is 1. Hence, it returns 0.7853981633974483 radians, i.e., (45°*pi)/180, as arctan (1) = 45°.
Returns the logarithmic value (LogeN) of the specified number.
<number / decimal>.log();
info 81.log(); /// Returns: 4.394449154672439
functionId tryout-examplenumber=1; info number.log();
Returns the logarithmic value of the given number (log of given number).
<number / decimal>.log();
Here the 'log()' function returns the logarithmic value of the given integer. This will be calculated as log of given number, hence it returns '0.0'.
Returns the maximum value in a set of two numeric values.
<number / decimal>.max(<number / decimal>);
info 5.max(7); /// Returns: 7
functionId tryout-exampleresult = 10.max(20); info result;
Returns the maximum of the two numbers.
<number / decimal>.max(<number / decimal>);
Here the 'max()' function compares given values and returns the maximum of the two values, hence it returns '20'.
Returns the minimum value in a set of two numeric values.
<number / decimal>.min(<number / decimal>);
info 5.min(7); /// Returns: 5
functionId tryout-exampleresult = 10.min(20); info result;
Returns the minimum of the two numbers.
<number / decimal>.min(<number / decimal>);
Here the 'min()' function compares given values and returns the minimum of the two values, hence it returns '10'.
Returns 'e' raised to the power of a given number
<number / decimal>.exp();
info 1.exp(); /// Returns: 2.718281828459045
functionId tryout-examplenumber=0; info number.exp();
Returns the exponential value of the given number (e raised to power of number).
<number / decimal>.exp();
Here the 'exp()' function returns the exponential value of the given integer. The number will be raised to power of 'e', hence it returns '1.0'.
Returns the result of a number raised to a power.
<number / decimal>.power(<number / decimal>);
info 5.power(2); /// Returns: 25
functionId tryout-exampleresult = 10.power(3); info result;
Returns the result of first number raised to power of second number.
<number / decimal>.power(<number / decimal>);
Here in the 'power()' function first number '10' multiplies itself '3' (second number) times, hence the result is '1000'.
Returns the number after rounding off to the specified number of digits.
<number / decimal>.round(<number>);
info 81.256.round(2); /// Returns: 81.26
functionId tryout-examplenumber = 3.123456; info number.round(4);
Returns a number after rounding it off to given number of digits.
<number / decimal>.round(<number>);
Here the 'round()' function rounds off given number "3.123456" to the specified number '4', hence the result is '3.1235'.
Returns a positive square root.
<number / decimal>.sqrt();
info 81.sqrt(); /// Returns: 9.0
functionId tryout-examplenumber = 25; info number.sqrt();
Returns the square root of given positive number.
<number / decimal>.sqrt();
Here the 'sqrt()' function returns the square root of the given number '25', hence it returns '5.0'. Square root of negative value will not be calculated.
Converts an integer to a hexadecimal value.
<number / decimal>.toHex();
info 75.toHex(); /// Returns: "4b"
functionId tryout-examplenumber=100; info number.toHex();
Converts the given number into hexadecimal format and returns the value.
<number / decimal>.toHex();
Here 'toHex()' function will convert the given number '100' to its equivalent hexa-decimal format, hence it returns '64'.
Returns the Number to Words of given language
<number>.toWords(<text>);
info 1.toWords("en-gb"); /// Returns: "One"
functionId tryout-examplenumber = -24; info number.toWords("en-us");
Converts the supplied input <number> to words in the specified <language> .
<number>.toWords(<text>);
Here, the 'toWords()' function converts the input number '-24' to its equivalent words in English language. Hence, it returns minus twenty-four. A number can be positive, negative or in fraction.
Returns the number rounded down to the nearest integer.
<decimal>.floor();
info 5.2.floor();/// Returns: 5
functionId tryout-examplefieldValue=9.5; info fieldValue.floor();
Returns the number by rounding it down to the next nearest smaller integer.
<decimal>.floor();
Here 'floor()' function converts a given number by rounding it down to the next nearest smaller integer, hence it retruns '9'.
Returns the number rounded up to the nearest integer.
<number / decimal>.ceil();
info 5.2.ceil(); /// Returns: 6
functionId tryout-examplefieldValue=9.5; info fieldValue.ceil();
Returns the number by rounding it up to the next nearest greater integer.
<number / decimal>.ceil();
Here 'ceil()' function converts a given number by rounding it up to the next nearest greater integer, hence it retruns '10'.
Returns true if field value/expression is even.
<number>.isEven();
info isEven(153480); /// Returns: true
functionId tryout-examplenumber = 200017; iseven = isEven(number); info iseven;
Test whether given number is even or not. Throws error other than numbers.
<number>.isEven();
Here the passed number value is odd. Hence this method will return 'false'.
Returns true if field value/expression is odd.
<number>.isOdd();
info isOdd(153480); /// Returns: false
functionId tryout-examplenumber = 200017; odd = isOdd(number); info odd;
Test whether given number is odd or not. Throws error other than numbers.
<number>.isOdd();
Here the passed 'number' value is odd. Hence this method will return 'true'.
Returns the base 10 logarithm value (Loge10) of the specified number.
<number / decimal>.log10();
info 81.log10(); /// Returns: 1.9084850188786497
functionId tryout-examplenumber=81; info number.log10();
Returns base 10 logarithmic value of the given number (log10 of given number).
<number / decimal>.log10();
Here the 'log10()' function returns base 10 logarithmic value of the given integer. It returns 1.9084850188786497.
date-time Functions
Returns a date-time value after adding the specified number of days.
<date>.addDay(<number>);
info '3-Oct-1993 12:24:36'.addDay(15); /// Returns: '18-Oct-1993 12:24:36'
functionId tryout-examplecurrentDate='1-Jan-1990 20:50:36'; info currentDate.addDay(10);
Returns a date-time value after adding the specified number of days to the given date-time value.
<date>.addDay(<number>);
Here 'addDay()' function adds the specified number of days '10' to the given date-time value '1-Jan-1990 20:50:36', hence it returns '11-Jan-1990 20:50:36'.
Returns a date-time value after adding the specified number of months
<date>.addMonth(<number>);
info '25-Jan-1988 12:24:36'.addMonth(10); /// Returns: '25-Nov-1988 12:24:36'
functionId tryout-examplecurrentDate='1-Jan-1990 20:50:36'; info currentDate.addMonth(15);
Returns a date-time value after adding the specified number of months to the given date-time value.
<date>.addMonth(<number>);
Here 'addMonth()' function adds the specified number of months '15' to the given date-time value '1-Jan-1990 20:50:36', hence it returns '1-Apr-1991 20:50:36'.
Returns a date-time value after adding the specified number of years
<date>.addYear(<number>);
info '25-Jan-1988 12:24:36'.addYear(5); /// Returns: '25-Jan-1993 12:24:36'
functionId tryout-examplecurrentDate='1-Jan-1990 20:50:36'; info currentDate.addYear(15);
Returns a date-time value after adding the specified number of Years to the given date-time value.
<date>.addYear(<number>);
Here 'addYear()' function adds the specified number of Years '15' to the given date-time value '1-Jan-1990 20:50:36', hence it returns '1-Jan-2005 20:50:36'.
Returns a date-time value after adding the specified number of weeks.
<date>.addWeek(<number>);
info '25-Jan-1988 12:24:36'.addWeek(5); /// Returns: '29-Feb-1988 12:24:36'
functionId tryout-examplecurrentDate='1-Jan-1990 20:50:36'; info currentDate.addWeek(15);
Returns a date-time value after adding the specified number of Weeks to the given date-time value.
<date>.addWeek(<number>);
Here 'addWeek()' function adds the specified number of Weeks '15' to the given date-time value '1-Jan-1990 20:50:36', hence it returns '16-Apr-1990 20:50:36'.
Returns the date of the month from the given date
<date>.getDay();
info '25-Jan-1988 12:24:36'.getDay(); /// Returns: 25
functionId tryout-examplecurrentDate='1-Jan-1990 20:50:36'; info currentDate.getDay();
Returns the date from the given date-time value.
<date>.getDay();
Here 'getDay()' function returns the date from the given date-time value, hence it returns '1'.
Returns a number in the range (1 - 7), representing the number of the day of the week, that date falls. The number "1" represents Sunday, "2" represents Monday and so on.
<date>.getDayOfWeek();
info '21-Aug-2013 16:04:37'.getDayOfWeek(); /// Returns: 4
functionId tryout-examplecurrentDate='25-May-1990 20:50:36'; info currentDate.getDayOfWeek();
Returns the numeric value of number for day of the week for given date-time value ranging from 1 to 7.
<date>.getDayOfWeek();
Here 'getDayOfWeek()' function returns the numeric value ranging 1-7 which represents the number of day of the week in the given year (25-May-1990 20:50:36), hence it returns 6.
Returns the numerical value of the month from the specified date
<date>.getMonth();
info '25-Jan-1988 12:24:36'.getMonth(); /// Returns: 1
functionId tryout-examplecurrentDate='1-Jan-1990 20:50:36'; info currentDate.getMonth();
Returns the numeric value of month from the given date-time value.
<date>.getMonth();
Here 'getMonth()' function returns the numeric value of month from the given date-time value, hence it returns '1'.
Returns a number in the range (1 - 52), representing the number of the week in the year. For example, "16/1/2007" returns 3..
<date>.getWeekOfYear();
info '25-Nov-1988 12:24:36'.getWeekOfYear(); /// Returns: 48
functionId tryout-examplecurrentDate='25-May-1990 20:50:36'; info currentDate.getWeekOfYear();
Returns the numeric value of number for week for given date-time value ranging from 1 to 52.
<date>.getWeekOfYear();
Here 'getWeekOfYear()' function returns the numeric value ranging 1-52 which represents the number of week in the given year (25-May-1990 20:50:36), hence it returns 21 means 21st week of given year.
Returns the numerical value of the year from the date specified.
<date>.getYear();
info '20-May-2013 16:04:37'.getYear(); /// Returns: 2013
functionId tryout-examplecurrentDate='1-Jan-1990 20:50:36'; info currentDate.getYear();
Returns the value of year from the given date-time value.
<date>.getYear();
Here 'getYear()' function returns the year from the given date-time value, hence it returns '1990'.
Returns a date-time value after subtracting the specified number of days.
<date>.subDay(<number>);
datetime = '21-Aug-2013 16:04:37'.subDay(3); info datetime; /// Returns: '18-Aug-2013 16:04:37'
functionId tryout-examplecurrentDate='1-Jan-1990 20:50:36'; info currentDate.subDay(15);
Returns a date-time value after subtracting the specified number of days from the given date-time value.
<date>.subDay(<number>);
Here 'subDay()' function subtracts the specified number of days '15' from the given date-time value '1-Jan-1990 20:50:36', hence it returns '17-Dec-1989 20:50:36'.
Returns a date-time value after subtracting the specified number of months.
<date>.subMonth(<number>);
info '21-Aug-2013 16:04:37'.subMonth(3); /// Returns: '21-May-2013 16:04:37'
functionId tryout-examplecurrentDate='1-Jan-1990 20:50:36'; info currentDate.subMonth(15);
Returns a date-time value after subtracting the specified number of months from the given date-time value.
<date>.subMonth(<number>);
Here 'subMonth()' function subtracts the specified number of months '15' from the given date-time value '1-Jan-1990 20:50:36', hence it returns '01-Oct-1988 20:50:36'.
Returns a date-time value after subtracting the specified number of years.
<date>.subYear(<number>);
info '21-Aug-2013 16:04:37'.subYear(3); /// Returns: '21-Aug-2010 16:04:37'
functionId tryout-examplecurrentDate='1-Jan-1990 20:50:36'; info currentDate.subYear(15);
Returns a date-time value after subtracting the specified number of years from the given date-time value.
<date>.subYear(<number>);
Here 'subYear()' function subtracts the specified number of years '15' from the given date-time value '1-Jan-1990 20:50:36', hence it returns '01-Jan-1975 20:50:36'.
Returns a date-time value after subtracting the specified number of weeks.
<date>.subWeek(<number>);
info '21-Aug-2013 16:04:37'.subWeek(3); /// Returns: '31-Jul-2013 16:04:37'
functionId tryout-examplecurrentDate='1-Jan-1990 20:50:36'; info currentDate.subWeek(15);
Returns a date-time value after subtracting the specified number of weeks from the given date-time value.
<date>.subWeek(<number>);
Here 'subWeek()' function subtracts the specified number of weeks '15' from the given date-time value '1-Jan-1990 20:50:36', hence it returns '18-Sep-1989 20:50:36'.
Returns a date-time value after adding the specified number of hours.
<date>.addHour(<number>);
info '21-Aug-2013 16:04:37'.addHour(3); /// Returns: '21-Aug-2013 19:04:37'
functionId tryout-examplecurrentDate='1-Jan-1990 20:50:36'; info currentDate.addHour(5);
Returns a date-time value after adding the specified number of hours to the given date-time value.
<date>.addHour(<number>);
Here 'addHour()' function adds the specified number of hours '5' to the given date-time value '1-Jan-1990 20:50:36', hence it returns '02-Jan-1990 01:50:36'.
Returns a date-time value after adding the specified number of minutes.
<date>.addMinutes(<number>);
info '21-Aug-2013 16:30:37'.addMinutes(20); /// Returns: '21-Aug-2013 16:50:37'
functionId tryout-examplecurrentDate='1-Jan-1990 20:50:36'; info currentDate.addMinutes(15);
Returns a date-time value after adding the specified number of minutes to the given date-time value.
<date>.addMinutes(<number>);
Here 'addMinutes()' function adds the specified number of minutes '15' to the given date-time value '1-Jan-1990 20:50:36', hence it returns '01-Jan-1990 21:05:36'.
Returns a date-time value after adding the specified number of seconds.
<date>.addSeconds(<number>);
info '21-Aug-2013 12:30:40'.addSeconds(10); /// Returns: '21-Aug-2013 12:30:50'
functionId tryout-examplecurrentDate='1-Jan-1990 20:50:36'; info currentDate.addSeconds(15);
Returns a date-time value after adding the specified number of seconds to the given date-time value.
<date>.addSeconds(<number>);
Here 'addSeconds()' function adds the specified number of seconds '15' to the given date-time value '1-Jan-1990 20:50:36', hence it returns '01-Jan-1990 21:05:51'.
Returns a date-time value after subtracting the specified number of hours.
<date>.subHour(<number>);
info '21-Aug-2013 16:04:37'.subHour(3); /// Returns: '21-Aug-2013 13:04:37'
functionId tryout-examplecurrentDate='1-Jan-1990 20:50:36'; info currentDate.subHour(5);
Returns a date-time value after subtracting the specified number of hours from the given date-time value.
<date>.subHour(<number>);
Here 'subHour()' function subtracts the specified number of hours '5' from the given date-time value '1-Jan-1990 20:50:36', hence it returns '01-Jan-1990 15:50:36'.
Returns a date-time value after subtracting the specified number of minutes.
<date>.subMinutes(<number>);
info '21-Aug-2013 16:10:00'.subMinutes(10); /// Returns: '21-Aug-2013 16:00:00'
functionId tryout-examplecurrentDate='1-Jan-1990 20:50:36'; info currentDate.subMinutes(5);
Returns a date-time value after subtracting the specified number of minutes from the given date-time value.
<date>.subMinutes(<number>);
Here 'subMinutes()' function subtracts the specified number of minutes '5' from the given date-time value '1-Jan-1990 20:50:36', hence it returns '01-Jan-1990 20:45:36'.
Returns a date-time value after subtracting the specified number of seconds.
<date>.subSeconds(<number>);
info '21-Aug-2013 16:10:20'.subSeconds(10); /// Returns: '21-Aug-2013 16:10:10'
functionId tryout-examplecurrentDate='1-Jan-1990 20:50:36'; info currentDate.subSeconds(15);
Returns a date-time value after subtracting the specified number of seconds from the given date-time value.
<date>.subSeconds(<number>);
Here 'subSeconds()' function subtracts the specified number of seconds '15' from the given date-time value '1-Jan-1990 20:50:36', hence it returns '01-Jan-1990 20:50:21'.
Returns the date after specified number of days from the given date.
<date>.addBusinessDay(<number>);
info '21-Aug-2013'.addBusinessDay(3); /// Returns: '26-Aug-2013'
functionId tryout-examplecurrentDate='1-Jan-1990'; info currentDate.addBusinessDay(10);
Returns a date value after adding the specified number of working days to the given date.
<date>.addBusinessDay(<number>);
Here 'addBusinessDay()' function adds the specified number of working days '10' to the given date value '1-Jan-1990', hence it returns '15-Jan-1990'.
Return a number in the range 1-365, representing the number of the day of the year, the specified date falls on.
<date>.getDayOfYear();
info '21-Aug-2013'.getDayOfYear(); /// Returns: 233
functionId tryout-examplecurrentDate='1-Feb-1990'; info currentDate.getDayOfYear();
Returns the sequence number of the day of given year from the given date value.
<date>.getDayOfYear();
Here 'getDayOfYear()' function returns number ranging from 1-365 thereby representing sequence number of the day of given year, hence it returns '32'.
Returns the hour value alone from the specified time.
<date>.getHour();
info '04-Jul-2013 16:01:46'.getHour(); /// Returns: 16
functionId tryout-examplecurrentDate='1-Jan-1990 20:50:36'; info currentDate.getHour();
Returns the value of hour from the given date-time value.
<date>.getHour();
Here 'getHour()' function returns the hour value from the given date-time value, hence it returns '20'.
Returns the minute value alone from the specified time
<date>.getMinutes();
info '04-Jul-2013 16:01:46'.getMinutes(); /// Returns: 1
functionId tryout-examplecurrentDate='1-Jan-1990 20:50:36'; info currentDate.getMinutes();
Returns the value of minutes from the given date-time value.
<date>.getMinutes();
Here 'getMinutes()' function returns the minutes value from the given date-time value, hence it returns '50'.
Returns the seconds value alone from the specified date/time
<date>.getSeconds();
info '04-Jul-2013 16:01:46'.getSeconds(); /// Returns: 46
functionId tryout-examplecurrentDate='1-Jan-1990 20:50:36'; info currentDate.getSeconds();
Returns the value of seconds from the given date-time value.
<date>.getSeconds();
Here 'getSeconds()' function returns the seconds value from the given date-time value, hence it returns '36'.
Returns number of hours between the given start and end dates.
<date>.hoursBetween(<date>);
info '01-JAN-2015 01:58:01'.hoursBetween('02-JAN-2015 01:58:01'); /// Returns: 24
functionId tryout-exampledate1 = '1-Jan-2019 00:00:00'; date2 = '1-Jan-2019 12:12:12'; info date1.hoursbetween(date2);
Returns the difference of hours between the given start and end date-time values. If the start date-time is larger than the end date-time, the function returns a negative value.
<date>.hoursBetween(<date>);
Here, the function -hoursbetween calculates and returns the number of hours between the dates 1-Jan-2019 00:00:00 and 1-Jan-2019 12:12:12. Hence, it returns 12.
Returns a number in the range (1 - 11) representing the number of months between the given start and end dates.
<date>.monthsBetween(<date>);
info '04-Jul-2013'.monthsBetween('6-Jan-2014'); /// Returns: 6
functionId tryout-exampledate1='1-Jan-1990'; date2='31-May-1990'; info date1.monthsBetween(date2);
Returns a number which represents the number of months between two given dates.
<date>.monthsBetween(<date>);
Here 'monthsBetween()' function calculates the number of months between two given dates and returns a numeric value, hence it retruns '5'(date2 - date1). If we reverse the values of date1 and date2, a negative value will be returned.
Returns a number in the range (1 - ) representing the number of years between the given start and end dates.
<date>.yearsBetween(<date>);
info '04-Jul-2013'.yearsBetween('6-Jan-2017'); /// Returns: 3
functionId tryout-exampledate1 = '1-Jan-1990'; date2 = '1-Jan-2000'; info date1.yearsBetween(date2);
Returns a number which represents the number of years between two given dates.
<date>.yearsBetween(<date>);
Here 'yearsBetween()' function calculates the number of years between two given dates and returns a numeric value, hence it retruns '10'(date2 - date1). If we reverse the values of date1 and date2, a negative value will be returned.
Returns the last date of the month after adding/subtracting the specified number of months to the given month.
<date>.eomonth(<number>);
info '22-Oct-2015'.eomonth(3); /// Returns: '31-Jan-2016'
functionId tryout-examplecurrentDate='1-Jan-1990'; info currentDate.eomonth(5);
Returns the last date of the month after adding/subtracting the specified number of months from the given date value. Addition/Subtraction of months depends on value given in the function.
<date>.eomonth(<number>);
Here 'eomonth()' function adds/subtracts the specified number of months '5' from the given date value '1-Jan-1990' and returns last date of resulting month which is '30-Jun-1990'. To subtract the number of months, the month value should be given as negative (e.g. '-5').
Returns the date after specified number of workdays
<date>.workday(<number>);
info '22-Oct-2015'.workday(3); /// Returns: '27-Oct-2015'
functionId tryout-examplecurrentDate='1-Jan-1990'; weekends={"SATURDAY","SUNDAY"}; info currentDate.workday(10,weekends);
Returns a date value after adding the specified number of working days to the given date value.
<date>.workday(<number>);
Here 'workday()' function adds the specified number of days '10' to the given date value '1-Jan-1990', hence it returns '15-Jan-1990'. Since "Saturdays" and "Sundays" are escaped. We can provide weekends list as optional arguments.
Returns a numeric value from range (1-7) representing current week's day
<date>.weekday();
info '17-sep-2015 12:23:11'.weekday(); /// Returns: 5
functionId tryout-examplecurrentDate='25-May-1990 20:50:36'; info currentDate.weekday();
Returns the numeric value of number for the day of the week for given date-time value ranging from 1 to 7.
<date>.weekday();
Here 'weekday()' function returns the numeric value ranging 1-7 which represents the number of day of the week in the given date (25-May-1990 20:50:36), hence it returns '6' means 'Friday'(Sunday is first day).
Returns the starting date of the month, for a given date
<date>.toStartOfMonth();
info '21-Aug-2013'.toStartOfMonth(); /// Returns: '01-Aug-2013'
functionId tryout-examplefieldValue='31-Jan-1990'; info fieldValue.toStartOfMonth();
Returns the starting date of the month mentioned in the given date.
<date>.toStartOfMonth();
Here 'toStartOfMonth()' function will return the starting date of the month for the given date '31-Jan-1990', hence it returns '1-Jan-1990'.
Returns the starting date of the week, for a given date
<date>.toStartOfWeek();
info '04-Jul-2013'.toStartOfWeek(); /// Returns: '30-Jun-2013'
functionId tryout-examplefieldValue='31-Jan-1990'; info fieldValue.toStartOfWeek();
Returns the starting date of the week for a given date. First day is 'Sunday'.
<date>.toStartOfWeek();
Here 'toStartOfWeek()' function returns the starting date of the week for a given date, hence it returns '28-Jan-1990'(First day is 'Sunday').
Returns the fraction of a year that is represented by the number of whole days between two supplied dates
<date>.yearfraction(<date>);
info '01/01/2015'.yearfraction('01/11/2015'); /// Returns: 0.0273972602739726
functionId tryout-exampledate1='01/01/2015'; date2 = '03/01/2015'; yf = date1.yearfraction(date2); info yf;
This function finds the number of days between two specified dates and divides it by 365.
<date>.yearfraction(<date>);
The 'yearfraction' function, finds the number of days between the specified two dates - '01/01/2015 and '03/01/2015' and divides it by 365. The total number of days between the two dates is 59 (January - 31 days and February - 28 days). Hence, it returns the year fraction 0.16164383561643836 (i.e., 59/365).
calculates workingdays between the given start and end dates.
<date>.workdaysBetween(<date>);
info '04-Jan-2018'.workdaysBetween('9-Jan-2018'); /// Returns: 3
functionId tryout-exampledate1='1-Jan-1990'; date2='25-Jan-1990'; info date1.workdaysBetween(date2);
Returns a number which represents the number of workdays between two given dates.
<date>.workdaysBetween(<date>);
Here 'workdaysbetween()' function calculates the number of workdays between two given dates and returns a numeric value, hence it returns '18'. If we reverse the values of date1 and date2, a negative value will be returned.
Returns a number in the range (1 - ) representing the number of days between the given start and end dates.
<date>.daysBetween(<date>);
info '04-Jul-2013'.daysBetween('10-Jul-2013'); /// Returns: 6
functionId tryout-exampledate1='1-Jan-1990'; date2= '25-Jan-1990'; info date1.daysbetween(date2);
Returns a number which represents the number of days between two given dates.
<date>.daysBetween(<date>);
Here 'daysbetween()' function calculates the number of days between two given dates and returns a numeric value, hence it returns '24'. If we reverse the values of date1 and date2, a negative value will be returned.
calculates workingdays between the given start and end dates.
<date>.workdaysList(<date>);
info '04-Jan-2018'.workDaysList('9-Jan-2018'); /// Returns: Thu Jan 04 00:00:00 IST 2018,Fri Jan 05 00:00:00 IST 2018,Mon Jan 08 00:00:00 IST 2018,Tue Jan 09 00:00:00 IST 2018
functionId tryout-exampledate1='4-Jan-2018'; date2='09-Jan-2018'; info date1.workdayslist(date2);
Returns a list of days between two given dates.
<date>.workdaysList(<date>);
It will return a list of dates.We assume Saturday & Sunday as weekends.However we can overwrite them.Also we can configure holidays like holidays = {'8-Jan-2018'}.
returns current time with AM/PM either in 24 or 12 hours format.
<date>.getTime(<number>,<true/false>);
info '17-Jan-2018 18:10:37'.getTime(12); /// Returns: 06:10 PM
functionId tryout-exampletime = '17-Jan-2018 18:10:37'.getTime(12); info time; //returns 6:10 PM
Returns the time extracted from a date object in user readable format. If the second parameter is true, the seconds is displayed (if present in the source date). If it is false, the seconds is hidden. If it is not specified, takes false by default.
<date>.getTime(<number>,<true/false>);
Extracts the time from the given date object - 17-Jan-2018 18:10:37, and returns in 12 hours format. Hence, 06:10 PM is returned.
returns current date with AM/PM either in 24 or 12 hours format.
<datetime>.getDate();
info '17-Jan-2018 18:10:37'.getDate(); /// Returns: 17th January 2018
functionId tryout-examplecurrentDate = '17-Jan-2018 18:10:37'; info currentDate.getDate();
Returns the date in a readable format from a date object.
<datetime>.getDate();
getDate function displays date in a representable format than formal date
returns current time with AM/PM either in 24 or 12 hours format.
<datetime>.getDateTime(<number>,<true/false>);
info '17-Jan-2018 18:10:37'.getDateTime(); /// Returns: 17th January 2018,06:10 PM
functionId tryout-examplecurrentDate = '17-Jan-2018 18:10:37'; info currentDate.getDateTime(); //returns 17th January 2018,06:10 PM currentDate='17-Jan-2018 10:10:37'; info currentDate.getDateTime(12, true); // returns 17th January 2018,10:10:37 AM
Returns the date and time in a readable format from a date object. The
<datetime>.getDateTime(<number>,<true/false>);
getDateTime function displays date and time in a representable format.
Returns the date and time after specified number of working hours from the given date.
<date>.addBusinessHour(<decimal | number>);
info '04-Jan-2018'.addBusinessHour(20); /// Returns: 08-Jan-2018 13:00:00
functionId tryout-exampledate1='8-Jan-2018 9:00'; info date1.addbusinesshour(20); ///returns '10-Jan-2018 13:00'
Returns a date after adding number of working hours given.
<date>.addBusinessHour(<decimal | number>);
Here 'addBusinessHour' function adds 20 working hours to the given date-time value '8-Jan-2018 9:00'. Hence, it returns '10-Jan-2018 13:00'.
collection Functions
Inserts the values into collection
<collection>.insert(<collection>);
Items = Collection("Milk","Butter","Cheese"); Items.insert("Cream"); info Items; /// Returns: 'Milk, Butter, Cheese, Cream'
functionId tryout-exampleproduct_Detail= Collection("company":"Zoho","Product":"Creator"); product_Detail.insert("Plan":"Enterprise"); info product_Detail; products= Collection("Mail","Creator"); products.insert("CRM"); info products;
Inserts new element in the Collection variable and returns the updated variable. Element passed in function should be of same type as existing elements in the variable.
<collection>.insert(<collection>);
Here the 'Collection()' function allows you to insert data as either 'key-value' pair or 'values' only. The function 'insert()' allows you to insert new element in the Collection variable. Element passed in function should be of same type as existing elements in the variable. Hence it returns '{"company":"Zoho","Product":"Creator","Plan":"Enterprise"}'.
Inserts mulitple values into collection
<collection>.insertAll(<collection>);
product_Detail= Collection("company":"Zoho","Product":"Creator"); product_Detail.insertAll({"Plan":"Enterprise","ExpiresOn":"2018"}); info product_Detail; /// Returns: {"company":"Zoho","Product":"Creator","Plan":"Enterprise","ExpiresOn":"2018"}
functionId tryout-exampleproduct_Detail= Collection("company":"Zoho","Product":"Creator"); product_Detail.insertAll({"Plan":"Enterprise","ExpiresOn":"2018"}); info product_Detail;
Inserts set of new elements in the Collection variable and returns the updated variable. Elements passed in function should be of same type as existing elements in the variable.
<collection>.insertAll(<collection>);
Here the 'Collection()' function allows you to insert data as either 'key-value' pair or 'values' only. The function 'insertAll()' allows you to insert set of new elements in the Collection variable. Elements passed in function should be of same type as existing elements in the variable. Hence it returns '{"company":"Zoho","Product":"Creator","Plan":"Enterprise","ExpiresOn":"2018"}'.
Updates the value in collection
<collection>.update(<index | key>,<text>);
Items = Collection("Milk","Butter","Cheese","Cream"); Items.update(3,"IceCream"); info Items;/// Returns: 'Milk, Butter, Cheese, IceCream'
functionId tryout-exampleproduct_Detail= Collection("company":"Zoho","Product":"Creator","Plan":"Enterprise"); product_Detail.update("Plan","Free"); info product_Detail;
Updates an element in the Collection variable and returns the updated variable. Element passed in function should be of same type as existing elements in the variable.
<collection>.update(<index | key>,<text>);
Here the 'Collection()' function allows you to insert data as either 'key-value' pair or 'values' only. The function 'update()' allows you to update an element in the Collection variable. Element passed in function should be of same type as existing elements in the variable. Hence it returns '{"company":"Zoho","Product":"Creator","Plan":"Free"}'.
Removes a mentioned value and the key from the Collection variable
<collection>.delete(<text>);
Items = Collection("Milk","Cream","Butter","Cheese"); Items.delete("Cream"); info Items; /// Returns: 'Milk, Butter, Cheese'
functionId tryout-exampleproduct_Detail= Collection("company":"Zoho","Product":"Creator"); product_Detail.delete("Creator"); info product_Detail;
Removes specific 'value' along with its 'key' from the Collection variable and returns the updated Collection variable.
<collection>.delete(<text>);
Here the 'Collection()' function allows you to insert data as either 'key-value' pair or 'values' only. The function 'delete()' will remove specific value passed in the function, hence value "Creator" is removed and '{"company":"Zoho"}' is returned.
Removes multiple values and their keys from a Collection variable
<collection>.deleteAll(<collection>);
Items = Collection("Milk","Cream","Butter","Cheese"); Items.deleteAll({"Cream","Cheese"}); info Items; /// Returns: 'Milk, Butter'
functionId tryout-exampleproduct_Detail = Collection("company":"Zoho","Product":"Creator"); items = Collection("Creator","Zoho"); product_Detail.deleteAll(items); info product_Detail;
Removes multiple 'values' along with their 'keys' from the Collection variable and returns the updated Collection variable.
<collection>.deleteAll(<collection>);
Here the 'Collection()' function allows you to insert data as either 'key-value' pair or 'values' only. The function 'deleteAll()' will remove multiple values passed as a list type collection in the function, hence values '"Product":"Creator"' and '"company":"Zoho"' is removed and '{}' is returned which denotes empty variable.
Removes a mentioned key and the value from the Collection variable
<collection>.deleteKey(<text>);
details = Collection("Name":"John","Age":23,"company":"Zoho"); details.deleteKey("Name"); info details; /// Returns: '{"Age":23,"company":"Zoho"}'
functionId tryout-exampleproduct_Detail= Collection("company":"Zoho","Product":"Creator"); product_Detail.deleteKey("Product"); info product_Detail;
Removes specific 'key' along with its 'value' from the Collection variable and returns the updated Collection variable.
<collection>.deleteKey(<text>);
Here the 'Collection()' function allows you to insert data as either 'key-value' pair or 'values' only. The function 'deleteKey()' will remove specific 'key' passed in the function along with its value, hence value '"Product":"Creator"' is removed and '{"company":"Zoho"}' is returned.
Removes multiple keys and their values from a Collection variable
<collection>.deleteKeys(<array>);
details = Collection("Name":"John","Age":23,"company":"Zoho"); details.deleteKeys({"Name","Age"}); info details; /// Returns: '{"company":"Zoho"}'
functionId tryout-exampleproduct_Detail= Collection("company":"Zoho","Product":"Creator"); items = Collection("company","Product"); product_Detail.deleteKeys(items); info product_Detail;
Removes multiple 'keys' along with their 'values' from the Collection variable and returns the updated Collection variable.
<collection>.deleteKeys(<array>);
Here the 'Collection()' function allows you to insert data as either 'key-value' pair or 'values' only. The function 'deleteKeys()' will remove multiple 'keys' passed as a list type collection in the function, hence values '"Product":"Creator"' and '"company":"Zoho"' is removed and '{}' is returned which denotes empty variable.
Updates the value in collection
<collection>.sort(<true/false>);
details = Collection("Name":"John","company":"Zoho"); details.sort(false); info details;/// Returns: '{"company":"Zoho","Name":"John"}'
functionId tryout-exampleproduct_Detail= Collection("company":"Zoho","Product":"Creator"); product_Detail.sort(true); info product_Detail;
Rearranges the 'values' of the Collection variable alphabetically either in ascending/descending order (Depends on parameter passed).
<collection>.sort(<true/false>);
Here the 'Collection()' function allows you to insert data as either 'key-value' pair or 'values' only. The function 'sort()' will sort elements according to 'values' in Collection variable in ascending(true)/descending(false) order, hence the sorted order will be '{"Product":"Creator","company":"Zoho"}'. 'true' and 'false' are the boolean value passed in 'sort()' function.
Updates the value in collection
<collection>.sortKey(<true/false>);
details = Collection("Name":"John","Age":23,"Company":"Zoho"); info details.sortKey(false); /// Returns: '{"Name":"John","Company":"Zoho","Age":23}'
functionId tryout-exampleproduct_Detail= Collection("company":"Zoho","product":"Creator"); product_Detail.sortKey(true); info product_Detail;
Rearranges the 'keys' of the collection variable alphabetically either in ascending or descending order based on the parameter passed. The sortKey() function arranges the keys in case-sensitive order. In other words, when keys are arranged in ascending order, the uppercase characters are sorted before the lowercase characters, i.e., the sorting is done based on ASCII values.
<collection>.sortKey(<true/false>);
Here the 'Collection()' function allows you to insert data as either 'key-value' pair or 'values' only. However, the 'sortKey()' function is applied only to 'key-value' pair collection. The function sorts the elements according to the 'keys' of collection variable in ascending(true)/descending(false) order. Hence, the sorted order will be '{"company":"Zoho","product":"Creator"}'. 'true' and 'false' are the boolean values passed in 'sortKey()' function.
Removes all values in collection
<collection>.clear();
details = Collection("Name":"John","Age":23,"company":"Zoho"); details.clear(); info details; /// Returns: '{}'
functionId tryout-exampleproduct_Detail= Collection("company":"Zoho","Product":"Creator"); product_Detail.clear(); info product_Detail;
Removes all the elements from the Collection variable and returns an empty Collection variable.
<collection>.clear();
Here the 'Collection()' function allows you to insert data as either 'key-value' pair or 'values' only. The function 'clear()' will remove all the key-values present in the Collection, hence '{}' is retruned.
Checks for a specific key in collection
<collection>.containsKey(<text>);
details = Collection("Name":"John","Age":23,"company":"Zoho"); info details.containsKey("Age");/// Returns: 'true'
functionId tryout-exampleproduct_Detail= Collection("company":"Zoho","Product":"Creator"); result = product_Detail.containsKey("company"); info result;
Returns 'true' if the mentioned key is present in the Collection variable. Otherwise it will return false.
<collection>.containsKey(<text>);
Here the 'Collection()' function allows you to insert data as either 'key-value' pair or 'values' only. The function 'containsKey()' checks the 'key' passed in the function is present in the collection or not, hence 'true' is retruned.
Checks for a specific value in collection
<collection>.containsValue(<text>);
details = Collection("Name":"John","Age":23,"company":"Zoho"); info details.containsValue("John"); /// Returns: 'true'
functionId tryout-exampleproduct_Detail= Collection("company":"Zoho","Product":"Creator"); result = product_Detail.containsValue("Zoho"); info result;
Returns 'true' if the mentioned value is present in the Collection variable. Otherwise it will return false.
<collection>.containsValue(<text>);
Here the 'Collection()' function allows you to insert data as either 'key-value' pair or 'values' only. The function 'containsValue()' checks the 'value' passed in the function is present in the collection or not, hence 'true' is retruned.
Gets key associated to specific value in collection
<collection>.getKey(<text>);
details = Collection("Name":"John","Age":23,"company":"Zoho"); info details.getKey("John"); /// Returns: 'Name'
functionId tryout-exampleproduct_Detail= Collection("company":"Zoho","Product":"Creator"); result = product_Detail.getKey("Zoho"); info result;
Returns the 'key' associated with the 'value' passed in the function. Returns null if the value passed is not present.
<collection>.getKey(<text>);
Here the 'Collection()' function allows you to insert data as either 'key-value' pair or 'values' only. The function 'getKey()' returns the 'key' of the 'value' passed in the function. Hence "company" is returned.
Gets the key associated to a specific value occurred at last in collection
<collection>.getLastKey(<text>);
details = Collection("Name":"John","Age":23,"company":"Zoho","product":"Zoho"); info details.getLastKey("Zoho");/// Returns: 'product'
functionId tryout-exampleproduct_Detail= Collection("company":"Zoho","Product":"Creator","Brand":"Zoho"); result = product_Detail.getLastKey("Zoho"); info result;
Returns the 'key' associated with the 'value' occurred at last in the Collection variable. Returns null if the value passed is not present.
<collection>.getLastKey(<text>);
Here the 'Collection()' function allows you to insert data as either 'key-value' pair or 'values' only. The function 'getLastKey()' returns the 'key' of the 'value' occurred at last in the Collection variable. Hence "Brand" is returned.
Check whether the Collection variable is empty or not
<collection>.isEmpty();
details = Collection("Name":"John","Age":23,"company":"Zoho"); info details.isEmpty(); /// Returns: 'false'
functionId tryout-exampleproduct_Detail= Collection("company":"Zoho","Product":"Creator"); result = product_Detail.isEmpty(); info result;
Returns 'false' if Collection variable is not empty. Otherwise it will return false.
<collection>.isEmpty();
Here the 'Collection()' function allows you to insert data as either 'key-value' pair or 'values' only. The function 'isEmpty()' checks the variable and returns 'true' if no values are present and 'false' if variable is not empty. Hence 'false' is returned.
Returns the number of values present in the variable
<collection>.size();
details = Collection("Name":"John","Age":23,"company":"Zoho"); info details.size(); /// Returns: '3'
functionId tryout-exampleproduct_Detail= Collection("company":"Zoho","Product":"Creator"); result = product_Detail.size(); info result;
Returns number of 'key-values' or 'values' present in the variable. Returns '0' if variable is empty.
<collection>.size();
Here the 'Collection()' function allows you to insert data as either 'key-value' pair or 'values' only. The function 'size()' returns number of 'key-values' or 'values' present in the variable. Hence '3' is returned.
Returns a list of all the keys present in the variable
<collection>.keys();
details = Collection("Name":"John","Age":23,"company":"Zoho"); info details.keys(); /// Returns: 'Name,Age,company'
functionId tryout-exampleproduct_Detail= Collection("Company":"Zoho","Product":"Creator"); result = product_Detail.keys(); info result;
Returns the list containing all keys of the given Collection variable. Returns empty list if Collection variable contains nothing.
<collection>.keys();
Here the 'Collection()' function allows you to insert data as either 'key-value' pair or 'values' only. The function 'keys()' returns the list containing all keys of the given Collection variable. Hence "Company, Product" is returned.
Returns a list of all the values present in the variable
<collection>.values(<true/false>);
details = Collection("Name":"John","Age":23,"company":"Zoho"); info details.values(); /// Returns: 'John , 23 , Zoho'
functionId tryout-exampleproduct_Detail= Collection("company":"Zoho","Product":"Creator"); result = product_Detail.values(); info result;
Returns the list containing all values of the given Collection variable. Returns empty list if Collection variable contains nothing.
<collection>.values(<true/false>);
Here the 'Collection()' function allows you to insert data as either 'key-value' pair or 'values' only. The function 'values()' returns the list containing all values of the given Collection variable. Hence "Zoho, Creator" is returned.
Returns a list of all distinct values present in Collection variable
<collection>.distinct();
Items = Collection("Milk","Butter","Cream","Cheese","Milk"); info Items.distinct(); /// Returns: 'Milk, Butter, Cream, Cheese'
functionId tryout-exampleproduct_Detail= Collection("company":"Zoho","Product":"Creator","Brand":"Zoho"); result = product_Detail.distinct(); info result;
Returns the list containing all "distinct values" of the given Collection variable. Returns empty list if Collection variable contains nothing.
<collection>.distinct();
Here the 'Collection()' function allows you to insert data as either 'key-value' pair or 'values' only. The function 'distinct()' returns the list containing all "distinct values" of the given Collection variable. Hence "Creator, Zoho" is returned.
Returns a list of common elements present in two Collection variables
<collection>.intersect(<collection>);
Items_1 = Collection("Milk","Butter","Cream","Cheese"); Items_2 = Collection("Milk","Butter","Cheese"); info Items_1.intersect(Items_2); /// Returns: 'Butter, Cheese, Milk'
functionId tryout-exampleproduct_Detail_1= Collection("ZohoCreator","ZohoCRM","ZohoBooks"); product_Detail_2= Collection("ZohoCreator","ZohoCRM","ZohoDesk"); result= product_Detail_1.intersect(product_Detail_2); info result;
Returns the list containing all "common values" present in two given Collection variables. Does not work for key-value type variable.
<collection>.intersect(<collection>);
Here the 'Collection()' function allows you to insert data as either 'key-value' pair or 'values' only. The function 'intersect()' returns the list containing all "common values" present in two given Collection variables. Hence "ZohoCreator,ZohoCRM" is returned.
Returns a set of elements from any given Collection whose index is between start index, inclusive, and end index exclusive.
<list>.duplicate(<number>,<number>);
Items = Collection("Milk","Butter","Cream","Cheese"); info Items.duplicate(1,3); /// Returns: 'Butter, Cream'
functionId tryout-exampleproduct_List = Collection("Cream","Milk","Butter","Cheese"); result = product_List.duplicate(1,2); info result;
Returns set of elements of a given collection based on start and end index.
<list>.duplicate(<number>,<number>);
Here product_List contains four values. The function 'duplicate()' will return the set of elements as list based on start and end indexes passed in the function, hence it returns {"Milk"}.
list Functions
Obsolete
Returns 'true' if the element is present in the list
<list>.contains(<text>);
colors = {"Red", "Blue", "Green", "Yellow"}; ret = colors.contains("Red"); info ret; /// Returns: true
functionId tryout-exampleproduct_List={"Milk","Butter","Cream"}; info product_List.contains("Cream");
Returns 'true' if the mentioned element is present in the list. Otherwise it returns 'false'.
<list>.contains(<text>);
Here product_List contains three values. The function 'contains()' will check whether the element passed in the function is present in the list or not, hence it returns 'true'.If element is not present then it will return false.
Returns the String value at the specified index in list. Returns null if the list contains no value at the index specified.
<list>.get(<number>);
colors = {"Red", "Blue", "Green", "Yellow"}; ret = colors.get(2) ; info ret; /// Returns: "Green"
functionId tryout-exampleproduct_List={"Milk","Butter","Cream"}; result = product_List.get(1); info result;
Returns the value situated at given index of the list. Returns null for invalid index value.
<list>.get(<number>);
Here the List 'product_List' has three values. On entering index in 'get()' function, it will return the corresponding value, hence it returns "Butter". Index value should not exceed size of the list or else it will return null.
Returns the position of the given element in list (first element's position is '0')
<list>.indexOf(<text>);
colors = {"red", "blue", "green", "yellow"}; ret = colors.indexOf("green"); info ret; /// Returns: 2
functionId tryout-exampleproduct_List={"Milk","Butter","Cream"}; result = product_List.indexOf("Butter"); info result;
Returns the index of the value mentioned in the function.
<list>.indexOf(<text>);
Here the List 'product_List' has three values. On entering value in 'indexOf()' function, it will return the corresponding index, hence it returns '1'. Value entered should be available in the given List, otherwise it will return -1.
Returns the position of the last occurence of the element in the list.
<list>.lastIndexOf(<text>);
list = {"red", "blue", "green", "red", "blue"}; ret = list.lastIndexOf("red"); info ret; /// Returns: 3
functionId tryout-exampleproduct_List={"Milk","Butter","Cream","Milk","Butter"}; result = product_List.lastIndexOf("Butter"); info result;
Returns the index of the value occurred at last in the list.
<list>.lastIndexOf(<text>);
Here the List 'product_List' has five values. On entering value in 'lastIndexOf()' function, it will return the index occurred at last in the List, hence it returns '4'. Value entered should be available in the given List, otherwise it will return -1.
Remove and return the element at the specified index (first element's index is '0')
<list>.remove(<number>);
list = {"red","blue","green"}; list.remove(2); info list; /// Returns: {"red","blue"}
functionId tryout-exampleproduct_List={"Milk","Butter","Cream"}; result = product_List.remove(1); info product_List;
Removes the value situated at the specified index of the List and updates the indices of the succeeding values.
<list>.remove(<number>);
Here the List 'product_List' has three values. On entering index in 'remove()' function, it will remove the value at the specified index in the list and it updates the index of succeeding values in the list, hence the value "Butter" will be removed and the list now has only two values. Value entered should be available in the given List.
Removes and returns the specified element from a list
<list>.removeElement(<text>);
list = {"red","blue","green"}; list.removeElement("blue"); info list;/// Returns: {"red","green"}
functionId tryout-exampleproduct_List={"Milk","Butter","Cream"}; product_List.removeElement("Butter"); info product_List;
Removes the specific element from the list if it is present in the given list.
<list>.removeElement(<text>);
Here the List 'product_List' has three values. On entering value in 'removeElement()' function, it will remove the element, hence it will remove "Butter" from the list. Value entered should be available in the given List. If element is not found then list will remain unchanged.
Removes all list2 elements present in list1
<list1>.removeAll(<list2>);
list={"Red","Blue","Green"}; temp={"Green","Blue"}; list.removeAll(temp); info list;/// Returns: {"Red"}
functionId tryout-exampleproduct_List1={"Milk","Butter","Cheese","Cream"}; product_List2={"Milk","Cream"}; product_List1.removeAll(product_List2); info product_List1;
Removes elements of list2 from list1 and returns the updated list.
<list1>.removeAll(<list2>);
Here product_List1 and product_List2 contains 4 and 2 elements respectively. The function 'removeall()' will remove all elements of 'product_List2' from product_List1, hence it will return '{"Butter","Cheese"}.
Returns the list in the sorted order. The optional boolean specifies ascending(true)/descending(false)
<list>.sort(<true/false>);
list = {"red", "blue", "green", "yellow"}; info list.sort(true); /// Returns: {"blue","green","red","yellow"}
functionId tryout-exampleproduct_List={"Milk","Butter","Cream"}; info product_List.sort(true);
Rearranges the elements of the list alphabetically either in ascending/descending order (Depends on parameter passed).
<list>.sort(<true/false>);
Here product_List contains three values. The function 'sort()' will sort the elements of List in ascending(true)/descending(false) order, hence sorted list will be '{"Butter","Cream","Milk"}'. 'true' and 'false' are the boolean value passed in 'sort()' function.
Returns a number which represents the size of the given list.
<list>.size();
colors = {"Red", "Blue", "Green"}; ret = colors.size(); info ret; /// Returns: 3
functionId tryout-exampleproduct_List={"Milk","Butter","Cream","Cheese"}; result = product_List.size(); info result;
Returns the size of the given List.
<list>.size();
Here product_List contains four values. The function 'size()' will return the number of elements present in the list, hence it will return '4'. If list is empty then '0' is returned.
Returns a Boolean value - True if the list contains no values; - false, if the list contains values
<list>.isEmpty();
colors = {"Red", "Blue", "Green"}; ret = colors.isEmpty(); info ret; /// Returns: false
functionId tryout-exampleproduct_List={"Milk","Butter","Cream","Cheese"}; result = product_List.isEmpty(); info result;
Returns 'true' if list is empty. Otherwise it will return 'false'.
<list>.isEmpty();
Here product_List contains four values. The function 'isEmpty()' will return 'false' as 4 elements are present in the given list. If no element is present in the list then it will return 'true'.
Returns a set of elements from any given list whose index is between start index, inclusive, and end index exclusive.
<list>.subList(<number>,<number>);
colors = {"red", "blue", "green", "yellow"}; list = colors.subList(1,3); info list; /// Returns: {"blue","green"}
functionId tryout-exampleproduct_List={"Milk","Butter","Cream","Cheese"}; result = product_List.subList(1,2); info result;
Returns set of elements of a given list based on start and end index.
<list>.subList(<number>,<number>);
Here product_List contains four values. The function 'subList()' will return the set of elements as list based on start and end indexes passed in the function, hence it returns '{"Butter"}'.
Returns a specified list after removing all duplicate elements from it.
<list>.distinct();
colors = {"Red", "Green", "Green"}; list = colors.distinct(); info list;/// Returns: {"Red", "Green"}
functionId tryout-exampleproduct_List={"Milk","Butter","Cream","Cheese","Milk","Butter"}; result = product_List.distinct(); info result;
Removes all duplicate elements from the given list and returns a list with distinct elements.
<list>.distinct();
Here product_List contains six values. The function 'distinct()' will remove all the duplicate elements from the list and return the list with distinct elements, hence it returns '{"Milk","Butter","Cream","Cheese"}'.
Returns a list with common elements in 2 given lists.
<list1>.intersect(<list2>);
colors = {"red", "blue", "green", "orange"}; fruits = {"apple","orange","banana"}; list = colors.intersect(fruits); info list;/// Returns: {"orange"}
functionId tryout-exampleproduct_List1={"Milk","Butter","Cheese"}; product_List2={"Milk","Butter","Cream"}; result = product_List1.intersect(product_List2); info result;
Returns a list which contains the common elements of both the lists.
<list1>.intersect(<list2>);
The function 'intersect()' will return a list with the common elements present in both the lists, hence it returns '{"Butter", "Milk"}'. Returns an empty list if there are no common elements.
Adds the specified element at the last of the given list
<list>.add(<anyType>);
list = {"red", "blue", "green"}; list.add("yellow"); info list;/// Returns: {"red", "blue", "green", yellow};
functionId tryout-exampleproduct_List={"Milk","Butter","Cream"}; product_List.add("Cheese"); info product_List;
Adds the element to the list and returns the updated list.
<list>.add(<anyType>);
Here product_List contains four values. The function 'add()' will add the mentioned element to the list, hence the element "Cheese" will be added to the list, hence it will return '{"Milk","Butter","Cream","Cheese"}'.
Adds all elements to list1 from list2
<list1>.addAll(<list2>);
list = {"red"}; morecolors = {"green","yellow"}; list.addAll(morecolors); info list;/// Returns: {"red","green","yellow"}
functionId tryout-exampleproduct_List1={"Milk","Butter"}; product_List2={"Cheese","Cream","Bread"}; product_List1.addAll(product_List2); info product_List1;
Returns a list which contains the elements of both the lists.
<list1>.addAll(<list2>);
Here product_List1 and product_List2 contains 2 and 3 elements respectively. The function 'addAll()' will add the elements of both the list mentioned, hence it will return '{"Milk","Butter","Cheese","Cream","Bread"}.
Removes all elements from the list
<list>.clear();
list = {"red", "blue", "green"}; list.clear(); info list;/// Returns: {}
functionId tryout-exampleproduct_List={"Milk","Butter","Cream"}; product_List.clear(); info product_List;
Removes all the elements from the list and returns an empty list.
<list>.clear();
Here the List 'product_List' has three values. The function 'clear()' will remove all the values present in the list and return an empty list, hence '{}' is retruned.
Returns the smallest value of passed list
<list>.smallest();
price = {300,455,124,926,780}; ret = price.smallest(); info ret; /// Returns: "124"
functionId tryout-exampleprice = {300,455,124,926,780}; ret = price.smallest(); info ret;
Returns the smallest value of a passed list
<list>.smallest();
We arrange the passed list into ascending order and find the smallest one. Here price will be arranged as {124,300,455,780,926} and 124 is the smallest value.
Returns the largest value of passed list
<list>.largest();
price = {300,455,124,926,780}; ret = price.largest(); info ret; /// Returns: "926"
functionId tryout-exampleprice = {300,455,124,926,780}; ret = price.largest(); info ret;
Returns the max value of a passed list
<list>.largest();
We arrange the passed list into ascending order and find the maximum value. Here price will be arranged as {124,300,455,780,926} and 926 is the largest value.
Returns the average of passed values
<list>.average();
price = {300,455,124,926,780}; ret = price.average(); info ret; /// Returns: "517"
functionId tryout-exampleprice = {300,455,124,926,780}; ret = price.average(); info ret;
Returns the average of a passed list
<list>.average();
Usual 'average' calculation. Sum all values of the list and divide by total number of elements. (300+455+124+926+780)/5=517
Returns the nth percentile value
<list>.percentile(<number>);
marks = {300,455,124,926,780}; ret = marks.percentile(50); info ret; /// Returns: "455"
functionId tryout-examplemarks = {300,455,124,926,780}; ret = marks.percentile(50) ; info ret;
Returns the nth percentile value of a passed list
<list>.percentile(<number>);
Percentile calculation : Multiply percentile to be calculated number with the number of elements and divide the product by 100. Roundup to nearest whole number, call it as 'n'. Order the list in ascending. Find the n'th value from the list. Here 5X 50/100 = 2.5. Nearest whole number(n) is 3. So 455 is the 50th percentile.
Returns the median of passed values
<list>.median();
marks ={2,6,4}; ret = marks.median(); info ret; /// Returns: 4
functionId tryout-examplemarks ={300,455,124,926,780,890}; ret = marks.median(); info ret;
Returns the middlemost element of the specified collection of numbers. To get the median value, arrange the numbers in ascending/descending order. If the number of elements in the collection is even, the median is the average of the middle two elements. Otherwise, the middle element is the median of the collection.
<list>.median();
On arranging the elements of the given collection in ascending order, we get {124,300,455,780,890,926}. Here, the middle values are: 455 and 780. The median is the average of the middle values, i.e., (455+780)/2. Hence, it returns 617.5.
Returns the nthsmallest of passed values
<list>.nthsmallest(<number>);
marks = {300,455,124,926,780}; ret = marks.nthsmallest(2); info ret; /// Returns: "300"
functionId tryout-examplemarks = {300,455,124,926,780}; ret = marks.nthsmallest(2); info ret;
Returns the 'n'th smallest value of a passed list.
<list>.nthsmallest(<number>);
Finds the n'th smallest number from the list after sorting them in ascending. Here 2nd smallest number from sorted list {124,300,455,780,926} is 300.
Returns the nthlargest of passed values
<list>.nthlargest(<number>);
marks = {300,455,124,926,780}; ret = marks.nthlargest(4); info ret; /// Returns: "300"
functionId tryout-examplemarks = {300,455,124,926,780}; ret = marks.nthlargest(4); info ret;
Returns the 'n'th largest value of a passed list.
<list>.nthlargest(<number>);
Finds the n'th largest number from the list after sorting them in descending. Here 4th largest number from sorted list {124,300,455,780,926} is 300.
Returns the rank of passed values
<list>.rank(<number | decimal>,<text>);
marks = {300,455,124,926,780}; ret = marks.rank(926); info ret; /// Returns: 1
functionId tryout-examplemarks = {300,455,124,926,780}; ret = marks.rank(926); info ret; ret = marks.rank(926,"ASC"); info ret;
Returns the rank of passed values in a list.
<list>.rank(<number | decimal>,<text>);
Rank can be calculated by sorting list by ascending/descending order. In natural order rank(926) is 1 and in descending order ran(926) is 5.
key-value Functions
Obsolete
Returns a Boolean value - True, if this map contains a mapping for the specified key;- false, if this map does not contain a mapping for the specified key.
<map>.containKey(<text>);
map = {"1":"Red","2":"Blue"}; ret = map.containKey("1"); info ret;/// Returns: true
functionId tryout-exampleproduct_Map={"company":"Zoho","Product":"Creator","ticket":"123456"}; info product_Map.containKey("Product");
Returns 'true' if the mentioned key is present in the Map. Otherwise it returns 'false'.
<map>.containKey(<text>);
Here product_Map contains three values. The function 'containsKey()' will check whether the key passed in the function is present in the Map or not, hence it returns 'true'.If the key is not present in Map then it will return false.
Returns a Boolean value - True, if this map maps one or more keys to the specified value; otherwise false
<map>.containValue(<text>);
map = {"1":"Red","2":"Blue"}; ret = map.containValue("Blue"); info ret;/// Returns: true
functionId tryout-exampleproduct_Map={"company":"Zoho","Product":"Creator","ticket":"123456"}; info product_Map.containValue("Creator");
Returns 'true' if the mentioned value is present in the Map. Otherwise it returns 'false'.
<map>.containValue(<text>);
Here product_Map contains three values. The function 'containValue()' will check whether the value passed in the function is present in the Map or not, hence it returns 'true'.If value is not present then it will return false.
Returns the String value to which the specified key is mapped in this identity hash map. Returns null if the map contains no mapping for the specified key.
<map>.get(<text>);
map = {"1":"Red","2":"Blue"}; ret = map.get("2"); info ret;/// Returns: "Blue"
functionId tryout-exampleproduct_Map={"company":"Zoho", "product":"Creator"}; result = product_Map.get("company"); info result;
Returns the value associated to the mentioned key in the Map.
<map>.get(<text>);
Here the map 'product_Map' has two key-value pairs. On entering key in 'get()' function, it will return the corresponding value, hence it returns "Zoho".
Returns a Boolean value - True if this map contains no key-value mappings; - false, if this map contains key-value mappings
<map>.isEmpty();
map = {"1":"Red","2":"Blue"}; ret = map.isEmpty(); info ret;/// Returns: false
functionId tryout-exampleproduct_Map={"company":"Zoho","Product":"Creator","ticket":"123456"}; result = product_Map.isEmpty(); info result;
Returns 'true' if Map is empty. Otherwise it will return 'false'.
<map>.isEmpty();
Here product_Map contains three values. The function 'isEmpty()' will return 'false' as three elements are present in the given Map. If no element is present in the Map then it will return 'true'.
Returns a List of the keys contained in this map.
<map>.keys();
map = {"1":"Red","2":"Blue"}; keyList = map.keys(); info keyList;/// Returns: {"1","2"}
functionId tryout-exampleproduct_Map={"company":"Zoho","Product":"Creator","ticket":"123456"}; result = product_Map.keys(); info result;
Returns the list containing all keys of the given Map.
<map>.keys();
Here product_Map contains three values. The function 'keys()' will return a List containing all the keys of given Map, hence it returns '{"company","Product","ticket"}'. If Map is empty then returned list will also be empty.
Returns a number which represents the size of the given map.
<map>.size();
map = {"1":"Red","2":"Blue"}; ret = map.size(); info ret;/// Returns: 2
functionId tryout-exampleproduct_Map={"company":"Zoho","Product":"Creator","ticket":"123456"}; result = product_Map.size(); info result;
Returns the size of the given Map.
<map>.size();
Here product_Map contains three values. The function 'size()' will return the number of elements present in the Map, hence it will return '3'. If list is empty then '0' is returned.
Add key-value pairs to specified Map
<map>.put(<text1>,<text2>);
map = {"1":"Red","2":"Blue"}; map.put("3","yellow"); info map; /// Returns: {"1":"Red","2":"Blue","3":"yellow"}
functionId tryout-exampleproduct_Map={"company":"Zoho","Product":"Creator"}; product_Map.put("ticket","123456"); info product_Map;
Add new key-value pair in the given Map.
<map>.put(<text1>,<text2>);
Here product_Map contains two values. The function 'put()' will insert the key-value pair mentioned in the function into the given Map, hence the updated Map values will be '{"company":"Zoho","Product":"Creator","ticket":"123456"}'.
Add all key-value pairs to map1 from map2
<map1>.putAll(<map2>);
map = {"1":"Red","2":"Blue"}; temp={"3":"Green","4":"Yellow"}; map.putAll(temp); info map; /// Returns: {"1":"Red","2":"Blue","3":"Green","4":"Yellow"}
functionId tryout-exampleproduct_Map1={"company":"Zoho","Product":"Creator"}; product_Map2={"ticket":"123456","year":"2015"}; product_Map1.putAll(product_Map2); info product_Map1;
Puts all values of second Map into first Map.
<map1>.putAll(<map2>);
Here product_Map1 and product_Map2 both contains two values each. The function 'putAll()' will insert all the elements of product_Map2 into product_Map1, hence the updated Map elements of product_Map1 will be {"company":"Zoho","Product":"Creator","ticket":"123456","year":"2015"}.
Removes and returns the value mapped to the specified key from the map
<map>.remove(<key>);
map = {"1":"Read","2":"Blue"}; map.remove("1"); info map;/// Returns: {"2":"Blue"}
functionId tryout-exampleproduct_Map={"company":"Zoho","Product":"Creator","ticket":"123456","year":"2015"}; product_Map.remove("Product"); info product_Map;
Removes the value associated to the given key in the Map.
<map>.remove(<key>);
Here the Map 'product_Map' has four values. On entering key in 'remove()' function, it will remove the value associated to the key in the Map, hence the key-value {"Product":Creator"} will be removed. Key entered should be available in the given Map.
Removes all key-value pairs from the map
<map>.clear();
map = {"1":"Read","2":"Blue"}; map.clear(); info map;/// Returns: {}
functionId tryout-exampleproduct_Map={"company":"Zoho","Product":"Creator","ticket":"123456","year":"2015"}; product_Map.clear(); info product_Map;
Removes all the elements from the Map and returns an empty Map.
<map>.clear();
Here the Map 'product_Map' has four values. The function 'clear()' will remove all the key-values present in the map and return an empty Map, hence '{}' is retruned.
common Functions
Returns true if field value/expression is a date.
<text>.isDate();
info '21-Aug-2011'.isDate(); /// Returns: true
functionId tryout-examplefieldValue="1-Feb-1990"; info fieldValue.isDate();
Returns 'true' if a given value or expression is a date type. Otherwise it will return 'false'.
<text>.isDate();
Here 'isDate()' function is used to check if a field value or expression is a date type or not, hence it retruns 'true'.
Returns true if field value/expression is null.
<text>.isNull();
info "".isNull(); /// Returns: true
functionId tryout-examplefieldValue="ZohoCreator"; info fieldValue.isNull();
Returns 'true' if a given value or expression is null. Otherwise it will return 'false'.
<text>.isNull();
Here 'isNull()' function is used to check if a field value or expression is null or not, hence it returns 'false'.
Returns true if field value/expression is a number/decimal.
<text/number>.isNumber();
info 50.isNumber(); /// Returns: true
functionId tryout-examplefieldValue=100; info fieldValue.isNumber();
Returns 'true' if a given value or expression is a number type. Otherwise it will return 'false'.
<text/number>.isNumber();
Here 'isNumber()' function is used to check if a field value or expression is a number type or not, hence it retruns 'true'. For characters/special characters, it will return 'false'.
Returns true if field value/expression is a string.
<text/number>.isText();
info "Zoho Creator".isText(); /// Returns: true
functionId tryout-examplefieldValue="Welcome to Zoho Creator"; info fieldValue.isText();
Returns 'true' if a given value or expression is String type. Otherwise it will return 'false'.
<text/number>.isText();
Here 'isText()' function is used to check if a field value or expression is String type or not, hence it retruns 'true'. For numeric values, it will return 'false'.
Returns true if field value/expression is empty.
<text>.isBlank();
info " ".isBlank(); /// Returns: true
functionId tryout-examplefieldValue="Zoho"; info fieldValue.isBlank();
Returns 'true' if a given value or expression is empty. Otherwise it will return 'false'.
<text>.isBlank();
Here 'isBlank()' function is used to check if a given value or expression is empty, hence it retruns 'false'. For an empty field value or expression it will return 'true'.
Converts and returns any given expression into string format
<any-type>.toText();
info 34512.toText(); /// Returns: "34512"
functionId tryout-exampleproduct_quantity = 123456; result = product_quantity.toText(); info result;
Converts the given expression into text format. Here expression can be of any data type.
<any-type>.toText();
Here the expression '123456' will be converted to the text type, hence it will return "123456".
Returns Long from given expression. The hexadecimal string should be preceded by '0x'. Eg "0x1F".toNumber() returns hexadecimal value of '1F'.
<text/number>.toNumber();
info "81.34".toNumber(); /// Returns: 81
functionId tryout-exampleproduct_price = "12345.6"; result = product_price.toNumber(); info result;
Converts the given expression into number format.
<text/number>.toNumber();
Here the expression '12345.6' will be converted to the number type, hence it will return number value '12345' and built-in functions related to number can be applied now.
Converts format of specified argument 1 into format of specified argument 2
<number>.text(<text>);
info 123456.789.text("###,###.##"); /// Returns: "123,456.79"
functionId tryout-examplefieldValue=123456.789; info fieldValue.text("###,###");
Converts the number into the specificed format and returns it as text.
<number>.text(<text>);
Here 'text()' function converts the given value '123456' into mentioned format '###,###', hence it returns '123,456'.
Returns decimal value from given number/expression.
<text/number>.toDecimal();
info "81".toDecimal(); /// Returns: 81.00
functionId tryout-exampleproduct_quantity = "123"; result = product_quantity.toDecimal(); info result;
Converts the given expression into Decimal format. Here expression can be of any data type.
<text/number>.toDecimal();
Here the expression "123" will be converted to the decimal type, hence it will return 123.00 and now built-in functions related to number type can be applied
Converts a date that is stored as text to a format that Zoho Creator recognizes as a date.
<text/number>.toDate();
info "20-May-2013".toDate(); /// Returns: '20-May-2013'
functionId tryout-exampledateString = "1-Jan-2015"; result = dateString.toDate(); info result;
Converts the given date string expression into Date format.
<text/number>.toDate();
Here the string expression "1-Jan-2015" will be converted to the Date type, hence it will return '1-Jan-2015' and now built-in functions related to date type can be applied
Converts a date-time that is stored as text to a format that Zoho Creator recognizes as a date-time value.
<text/number>.toDateTime();
info "20-May-2013".toDateTime(); /// Returns: '20-May-2013 00:00:00'
functionId tryout-exampledateString = "1-Jan-2015 20:30:54 Sunday"; result = dateString.toDateTime(); info result;
Converts the given date-time string expression into Date-Time format.
<text/number>.toDateTime();
Here the string expression "1-Jan-2015 20:30:54 Sunday" will be converted to the Date-Time type, hence it will return '1-Jan-2015 20:30:54' and built-in functions related to date type can be applied.
xml Functions
Returns the String from the applied xpath
<XML/JSON text>.executeXPath(<xpath>);
info "
employeeDetail="
Extracts the data from the given XML/JSON text based on the path mentioned. Path is the node/key name of the give xml/json text.
<XML/JSON text>.executeXPath(<xpath>);
'employeeDetail' is a XML text which hold the employee details. The given path in executeXPath will extract the employee id out of the string.
file Functions
Returns the content of the input file
<file>.getfilecontent();
info "\"Name\",\"Age\"\n\"Mathew\",\"20\"".tofile("sample.csv").getFileContent();
functionId tryout-examplepdf_file = "Deluge, or Data Enriched Language for the Universal Grid Environment, is an online scripting language integrated with Zoho services.".tofile("sample.pdf"); info pdf_file.getFileContent(); // Note: Applying this function on files fetched using invokeURL task is the ideal use-case. However, due to security reasons we cannot use invokeURL for public demonstrations, therefore we have used the toFile function to demonstrate file functions.
Returns the content stored in the input file - <file>
<file>.getfilecontent();
In this example, the getFileContent() function returns the content of the file stored in the variable - pdf_file. Here, the toFile built-in function is used to create the pdf file.
Returns the name of the input file
<file>.getfilename();
info "\"Name\",\"Age\"\n\"Mathew\",\"20\"".tofile("sample.csv").getFileName(); // Returns sample.csv
functionId tryout-examplefile1 = "Deluge, or Data Enriched Language for the Universal Grid Environment, is an online scripting language integrated with Zoho services.".tofile("sample.pdf"); info file1.getFileName(); // returns sample.pdf // Note: Applying this function on files fetched using invokeURL task is the ideal use-case. However, due to security reasons we cannot use invokeURL for public demonstrations, therefore we have used the toFile function to demonstrate file functions.
Returns the name of the input file - <file>
<file>.getfilename();
In this example, the getFileName() function returns the name of the file stored in the variable - file1. Here, the toFile built-in function is used to create the file - file1.
Returns the size of input file
<file>.getfilesize();
info "\"Name\",\"Age\"\n\"Mathew\",\"20\"".tofile("sample.csv").getFileSize(); // Returns 26
functionId tryout-examplepdf_file = "Deluge, or Data Enriched Language for the Universal Grid Environment, is an online scripting language integrated with Zoho services.".tofile("sample.pdf"); info pdf_file.getFileSize(); // returns 132 (bytes) // Note: Applying this function on files fetched using invokeURL task is the ideal use-case. However, due to security reasons we cannot use invokeURL for public demonstrations, therefore we have used the toFile function to demonstrate file functions.
Returns the size of the input file - <file>
<file>.getfilesize();
In this example, the getFileSize() function returns the size (in bytes) of the file stored in the variable - pdf_file. Here, the toFile built-in function is used to create the pdf file.
Returns the content-type of input file
<file>.getfiletype();
info "\"Name\",\"Age\"\n\"Mathew\",\"20\"".tofile("sample.csv").getFileType(); // Returns csv
functionId tryout-examplesample_file = "Deluge, or Data Enriched Language for the Universal Grid Environment, is an online scripting language integrated with Zoho services.".tofile("sample.pdf"); info sample_file.getFileType(); // returns pdf // Note: Applying this function on files fetched using invokeURL task is the ideal use-case. However, due to security reasons we cannot use invokeURL for public demonstrations, therefore we have used the toFile function to demonstrate file functions.
Returns the content-type of the input file - <file>
<file>.getfiletype();
In this example, the getFileType() function returns the content type of the file stored in the variable - sample_file. Here, the toFile built-in function is used to create the pdf file
Returns 'true' if the input is a file. Otherwise, it returns 'false'
<file>.isfile();
info "\"Name\",\"Age\"\n\"Mathew\",\"20\"".tofile("sample.csv").isFile(); //Return true
functionId tryout-examplefileVariable = "Deluge, or Data Enriched Language for the Universal Grid Environment, is an online scripting language integrated with Zoho services.".tofile("sample.pdf"); info fileVariable.isFile(); // returns true // Note: Applying this function on files fetched using invokeURL task is the ideal use-case. However, due to security reasons we cannot use invokeURL for public demonstrations, therefore we have used the toFile function to demonstrate file functions.
Returns "true" if <file> is a file. Otherwise, it returns "false"
<file>.isfile();
In this example, the isFile() function returns "true" if the value stored in the variable - fileVariable is a file. Otherwise, it returns "false". Here, the toFile built-in function is used to create the file - fileVariable. Hence, it returns true
Sets the specified charset to the input file so the file will be encoded with the specified charset when sent in an HTTP request using invoke URL task
<file>.setcharset(<text>);
file_var = "\"Name\",\"Age\"\n\"Mathew\",\"20\"".tofile("sample.csv"); file_var.setCharSet("UTF-32"); //sets "UTF-32" as charset type info file_var;
functionId tryout-examplefileVariable="Deluge, or Data Enriched Language for the Universal Grid Environment, is an online scripting language integrated with Zoho services.".tofile("sample.pdf"); fileVariable.setCharSet("UTF-16"); info fileVariable; // Note 1: Applying this function on files fetched using invokeURL task is the ideal use-case. However, due to security reasons we cannot use invokeURL for public demonstrations, therefore we have used the toFile function to demonstrate file functions. //Note 2: The setCharSet built-in function does not return any value and hence its output cannot be displayed using info statement. The file stored in fileVariable will be encoded with "UTF-16" charset while sending in a HTTP request using invoke URL task.
Sets the specified charset - <text> to the input file - <file>
<file>.setcharset(<text>);
In this example, the setCharSet() function sets the charset - UTF-16 to the input file stored in the variable - fileVariable. Here, the toFile built-in function is used to create the pdf file - fileVariable.
Sets the specified name to the input file
<file>.setfilename(<text>);
file_var = "\"Name\",\"Age\"\n\"Mathew\",\"20\"".tofile("sample.csv"); file_var.setFileName("Renamed_file.csv"); //sets "Renamed_file" as file name info file_var.getFileName();
functionId tryout-examplefileVariable = "Deluge, or Data Enriched Language for the Universal Grid Environment, is an online scripting language integrated with Zoho services.".tofile("sample.pdf"); fileVariable.setFileName("sampleFile.pdf"); info fileVariable.getFileName() ; // Note: Applying this function on files fetched using invokeURL task is the ideal use-case. However, due to security reasons we cannot use invokeURL for public demonstrations, therefore we have used the toFile function to demonstrate file functions.
Sets the specified name - <text> to the input file - <file>
<file>.setfilename(<text>);
In this example, the setFileName function sets the file name "sampleFile.pdf" to the file stored in the variable - fileVariable. Here, the toFile built-in function is used to create the pdf file - fileVariable and the getFileName built-in function is used to fetch the name of the file - fileVariable.
Sets the specified MIME file type to the input file so the file will be treated as the specified file type when sent in an HTTP request using invoke URL task
<file>.setfiletype(<text>);
file_var = "\"Name\",\"Age\"\n\"Mathew\",\"20\"".tofile("sample"); file_var.setFileType("pdf"); //sets "pdf" as file type info file_var.getFileType();
functionId tryout-examplefileVariable = "Deluge, or Data Enriched Language for the Universal Grid Environment, is an online scripting language integrated with Zoho services.".tofile("sample"); fileVariable.setFileType("pdf"); info fileVariable.getFileType() ; // Note: Applying this function on files fetched using invokeURL task is the ideal use-case. However, due to security reasons we cannot use invokeURL for public demonstrations, therefore we have used the toFile function to demonstrate file functions.
Sets the specified file type - <text> to the input file - <file>
<file>.setfiletype(<text>);
In this example, the setFileType() function sets the file type - pdf to the input file stored in the variable - fileVariable. Here, the toFile built-in function is used to create the file - fileVariable and the getFileType built-in function is used to type the name of the file - fileVariable
Returns the files extracted from the input ZIP file
<file>.extract();
info "\"Name\",\"Age\"\n\"Mathew\",\"20\"".tofile("sample.pdf").compress("compressed_file").extract(); // Returns {"sample.pdf":"sample.pdf"}
functionId tryout-examplezip_file= "Deluge, or Data Enriched Language for the Universal Grid Environment, is an online scripting language integrated with Zoho services.".tofile("sample.pdf").compress("compressed_file"); file_collection = zip_file.extract(); info file_collection ; // Note: Applying this function on files fetched using invokeURL task is the ideal use-case. However, due to security reasons we cannot use invokeURL for public demonstrations, therefore we have used the toFile function to demonstrate file functions.
Extracts the files from the input compressed file - <file>
<file>.extract();
In this example, the extract() function extracts the content of the input zip file stored in the variable - zip_file. The extracted response is a collection with the name of the extracted file as the key and the corresponding file as the value. Here, the toFile built-in function is used to create a pdf file and compress built-in function is used to create the zip file.
Returns the input file(s) compressed into a single ZIP file of .zip format
<map / list / file>.compress(<text>);
info "\"Name\",\"Age\"\n\"Mathew\",\"20\"".tofile("sample.csv").compress("compressed_file"); // Returns "compressed_file.zip"
functionId tryout-examplefileVariable ="Deluge, or Data Enriched Language for the Universal Grid Environment, is an online scripting language integrated with Zoho services.".tofile("sample.pdf"); zip_file = fileVariable.compress("compressed_file"); info zip_file; // Note: Applying this function on files fetched using invokeURL task is the ideal use-case. However, due to security reasons we cannot use invokeURL for public demonstrations, therefore we have used the toFile function to demonstrate file functions.
Compresses the input file or list of files stored in <file> into a ZIP file. The specified file name - <text> will be set to the compressed file
<map / list / file>.compress(<text>);
In this example, the compress() function compresses the input file stored in the variable - fileVariable into a .zip file. The file stored in "fileVariable" is fetched from toFile Function. Here, the toFile built-in function is used to create the file - fileVariable
Creates a file object with the specified content
<text / map / list>.tofile(<text>);
info "\"Name\",\"Age\"\n\"Mathew\",\"20\"".tofile("sample.csv"); // Returns "sample.csv"
functionId tryout-examplepdf_file="Deluge, or Data Enriched Language for the Universal Grid Environment, is an online scripting language integrated with Zoho services.".tofile("sample.pdf"); info pdf_file; // returns "sample.pdf"
Converts the text stored in <text1> into a file object. The specified file name - <text2> will be set to the created file
<text / map / list>.tofile(<text>);
In this example, the toFile() function converts the text stored in the variable - pdf_file to a file with the name and extension - sample.pdf. It is advisable to use file objects from the cloud directly and only in the absence of such means should this task be used.
sets the specified multipart param name to the input file
<file>.setparamname(<text>);
file_var = "\"Name\",\"Age\"\n\"Mathew\",\"20\"".tofile("sample.csv"); file_var.setParamName("file"); // Sets "file" as param name to the file info file_var;
functionId tryout-examplefileVariable ="Deluge, or Data Enriched Language for the Universal Grid Environment, is an online scripting language integrated with Zoho services.".tofile("sample.pdf"); fileVariable.setParamName("samplefile"); info fileVariable; // Note 1: Applying this function on files fetched using invokeURL task is the ideal use-case. However, due to security reasons we cannot use invokeURL for public demonstrations, therefore we have used the toFile function to demonstrate file functions. //Note 2: The setParamName built-in function does not return any value and hence its output cannot be displayed using info statement. The param name "samplefile" will be set to the file stored in fileVariable while sending in a HTTP request using invoke URL task.
sets the name stored in <text1> as multipart param name of the file object - <file>
<file>.setparamname(<text>);
In this example, the setParamName function sets the specified name as param name for the file object that needs to be sent in multipart form-data using invokeUrl. Here, the toFile built-in function is used to create the file - fileVariable. This function cannot be applied on files fetched using fetch records task or input.