--- title: "Automation Functions" slug: "automation-functions" updated: 2026-10-07T11:23:43Z published: 2026-10-07T11:23:43Z canonical: "success.panaya.com/automation-functions" --- > ## Documentation Index > Fetch the complete documentation index at: https://success.panaya.com/llms.txt > Use this file to discover all available pages before exploring further. # ScriptBuilder Functions Panaya's test automation ScriptBuilder offers a comprehensive range of functions to streamline and enhance the automation process. Functions are accessible when adding new [parameters](/v1/docs/automation-input-parameters-data-sets), [validating instructions](/v1/docs/script-builder-instruction-types), and in many other areas of ScriptBuilder. ![](https://cdn.document360.io/f404076c-de23-4609-848e-2dfd4ef701b0/Images/Documentation/image-8ZEIIYVA.png) Keep the [Expression](/v1/docs/expressions) checkbox selected so Panaya can evaluate the input as an expression. Text inputs are not evaluated and are treated as string tests. ![](https://cdn.document360.io/f404076c-de23-4609-848e-2dfd4ef701b0/Images/Documentation/image-QFV3IYBU.png) > [!NOTE] > Good to Know! > > Parameters are valid values inside functions. > > This means that once a function is called, any parameters passed into it can be used to work dynamically with different inputs. --- ## Text Functions ### Left Left returns the first character or characters in a text string based on the number of characters you specify. Syntax - Left('text', [num_chars]) Example - Left('Sale Price', 4) = 'Sale' ### Right Right returns the last character or characters in a text string based on the number of characters you specify. Syntax - Right('text',[num_chars]) Example - Right('Sale Price', 5) = 'Price' ### Mid Mid returns a specific number of characters from a text string, starting at the position you specify, based on the number of characters you specify. The starting position begins from 1. Syntax - Mid('text', start_num, num_chars) Example - Mid('Fluid Flow',1,5) = 'Fluid' If start_num is greater than the length of text, Mid returns '' (empty text). If start_num is less than the length of text, but start_num plus num_chars exceeds the length of text, Mid returns the characters up to the end of text. ### Concatenate The concatenate function joins two text strings into one string. Syntax - Concatenate('text1', 'text2') Example - Concatenate('Sale', ' Price') = 'Sale Price' ### Contains Determines whether the value occurs within the text, and returns TRUE/FALSE. Syntax - Contains('text', value) Example - Contains('Original Text', 'nal') = True ### Starts_with Determines whether the beginning of the text matches value parameter and returns TRUE/FALSE. Syntax - Starts_with('text', value) Example - Starts_with('Original Text', 'Ori') = True ### Ends_with Determines whether the end of the text matches value parameter and returns TRUE/FALSE. Syntax - Ends_with('text', value) Example - Ends_with('Original Text', 'xt') = True ### Len Returns the length of a string. Syntax - Len('text') Example - Len('Text') = 4 ### Replace Replaces a specified value in a text string with a new value. Syntax - Replace('text', old_value, new_value) ### Remove Removes a specified value from a text string. Syntax - Remove('text', value) ### Str_to_num Returns the number that is the representation of the specified string. Syntax - Str_to_num('text' [, group_separator, decimal_separator]) Example - Str_to_num('-1,234.56') = -1234.56 Supports English number formatting such as **1,234.56** and European number formatting such as **1.234,56**. Use the optional **group_separator** and **decimal_separator** arguments when converting locale-specific values. ### Num_to_str Returns the string that represents the specified number. Syntax - Num_to_str(number [, group_separator, decimal_separator]) Example - Num_to_str(-1234.56) = '-1234.56' Supports English number formatting such as **1,234.56** and European number formatting such as **1.234,56**. Use the optional **group_separator** and **decimal_separator** arguments when formatting locale-specific values. ### Upper Returns the string with all letters capitalized. Syntax - upper('Text') = TEXT The function will return an error if the input is numeric (without ' '). ### Lower Returns the string without capitalization. Syntax - lower('Text') = text The function will return an error if the input is numeric (without ' '). ### Find The find function returns the position of a specified character or substring within a supplied text string. Syntax - Find('find_text', 'within_text') Example - Find( 'T', 'Original Text' ) = 10 ### Is_string Returns True if the value is a string. Syntax - Is_string(value) Example - Is_string('abc') = True --- ## Number Functions > [!NOTE] > Strings vs. Numbers > > Strings and numbers cannot be directly compared in expressions ('123' > 23 is invalid). Always compare numbers to numbers or strings to strings. > > - Use [num_to_str](/v1/docs/automation-functions#numtostr) or [str_to_num](/v1/docs/automation-functions#numtostr) to convert values when necessary. > - Digits captured from the screen (e.g., 123) are treated as numbers. > - Functions like Left(123,1) return a string ('1'), which cannot be compared with numbers. ### Min Min function returns the smallest value in 2 given values. Syntax - Min(num1, num2) Example - Min(10,2) = 2 Arguments can either be numbers or expressions that return a number. Entering more or less than 2 arguments will cause an error. ### Max Max function returns the largest value in 2 given values. Syntax - Max(num1, num2) Example - Max(10,2) = 10 Arguments can either be numbers or expressions that return a number. Entering more or less than 2 arguments will cause an error. ### Random Returns a random number within a specified range. Syntax - Random(min_value,max_value) Example - Random(2,10) = 7 ### Abs Returns the absolute value of a specified number. Syntax - Abs(number) Example - Abs(-5) = 5 ### Ceiling Returns the smallest integer greater than or equal to the specified number. Syntax - Ceiling(number) Example - Ceiling(3.2) = 4 ### Floor Returns the largest integer less than or equal to the specified number. Syntax - Floor(number) Example - Floor(3.8) = 3 ### Round Rounds a value to the nearest integer or specified number of decimal places. If the number_of_decimals is greater than 0, it will return a value to the nearest integer or the specified number of fractional digits. If the number_of_decimals equals 0, the closest integer number will be returned. A negative number_of_decimals will return an error. Syntax - Round(number,number_of_decimals) Example - round(3.5,0) = 4 ### Sign Returns a value indicating the sign of a number. It returns 1 for positive numbers, 0 if the value is 0, and -1 for negative numbers. Syntax - Sign(number) Example - Sign(-7) = -1 ### Truncate Calculates an integral part of a number. Syntax - Truncate(number) Example - Truncate(3.9) = 3 ### In In Returns, whether an element is in a set of values. Syntax - In(value,value1,value2,...) Example - In(5, 1, 10, 5, 3) = 'True' ### If If Returns a value based on a condition. Syntax - If(condition, true_value, false_value) Example - If(5 > 3, 'Yes', 'No') = 'Yes' ### Is_number Returns True if the value represents a numerical value. Syntax - Is_number(value) Example - Is_number('5') = True --- ## Date Functions ### Today Returns the current date. The date format matches the script date format. Syntax - Today() Example - Today() + 1 ![](https://cdn.document360.io/f404076c-de23-4609-848e-2dfd4ef701b0/Images/Documentation/image-CBGJUB68.png) ### Now Returns the date in the script date format and the time (hour:minute: seconds) separated by a space, as shown in the example below. Syntax - Now() Example - Now() ![](https://cdn.document360.io/f404076c-de23-4609-848e-2dfd4ef701b0/Images/Documentation/image-HGKW2YH6.png) ### Last day of the month Returns the last day of the month of the given date. The date inputted should match the defined script date format. Syntax - Last_day_of_month('Date') Example - Last_day_of_month('1/13/2018') = 31 ### Day_of Returns the day of the given date. The date inputted should match the defined script date format. Syntax - Day_of('Date') Example - Day_of('1/1/2025') = 1 ### Month_of Returns the month of the given date. The date inputted should match the defined script date format. Syntax - Month_of('Date') Example - Month_of('1/5/2025') = 1 ### Year_of Returns the year of the given date. The date inputted should match the defined script date format. Syntax - Year_of('Date') Example - Year_of('13/1/2025') = 2025 ### Day_of_week Returns the day of the week of the given date. The date inputted should match the defined script date format. Syntax - Day_of_week('Date') Example - Day_of_week('1/12/2025') = 1 ### Date Returns a date constructed from the given month, day, and year. Syntax - Date(arg1,arg2,arg3) Example - Date(1,13,2018) = 1/13/2018 (When date format is MM/DD/YYYY) ### Is_date Returns True if the value is a date in the format defined in the [script settings](/v1/docs/scriptbuilder-settings#date-format). Syntax - Is_date(value) Example - Is_date('10/15/2018') = True ### Str_to_date Returns the extracted date from the specified string and the given date format into the date format specified in the script settings. Syntax - Str_to_date(string, date_format) Example - Str_to_date('15 Apr, 2026', 'dd MMM, yyyy') = '04/15/2026' if the script settings date format is 'MM/DD/YYYY' ### Date_to_str Returns the string that is the representation of the specified date in the given date format. Syntax - Date_to_str(date, date_format) Example - Date_to_str('15 Apr, 2026', 'MM/DD/YYYY') = '04/15/2026' if the script settings date format is 'dd MMM, yyyy' > **Note** > > The date format should match the Script Setting format. --- ## Time Functions #### Time now The “Time now” function returns the current time in the format defined in the script settings. Syntax - Time_now() #### Seconds of The “Seconds of” function returns the seconds of the given time. Syntax - Seconds_of(Time) Example - Seconds_of("14:30:45") = 45 #### Minutes of The “Minutes of” function returns the minutes of the given time. Syntax - Minutes_of(Time) Example - Minutes_of("14:30:45") = 30 #### Hours of The “Hours of function” function returns the hours of the given time. Syntax - Hours_of(Time) Example - Hours_of("14:30:45") = 14 #### Time The “Time” function returns a time constructed from the given hours, minutes, and seconds, in the format defined in the script settings. Syntax - Time(hours, minutes, seconds) Example - Time(14,30,45) = 14:30:45 #### Is time The “Is time” function returns True if the value is a time in the format defined in the script settings. Syntax - Is_time(Time) Example - Is_time("14:30:45") = True #### Time of The “Time of” function returns the time portion of the given date and time, formatted according to the settings in the script. Syntax - Get_time(DateTime) Example - Get_time("01/13/2018 14:30:45") = 14:30:45 #### Date of The “Date of function” returns the date portion of a combined date and time value. The output format follows the date format defined in the script settings. Syntax - Date_of(DateTime) Example - Date_of("01/13/2018 14:30:45") = 01/13/2018 --- ## Multi-Value Parameter Functions ### Num of cells Returns the size of an [array](/v1/docs/multi-value-parameters). Syntax - Num_of_cells(array) Example: Num_of_cells(array) = 3 ### Num of rows Returns the number of rows in a [matrix](/v1/docs/multi-value-parameters). Syntax - Num_of_rows(matrix) Example - Num_of_rows(matrix) = 3 ### Num of columns Returns the number of columns in a [matrix](/v1/docs/multi-value-parameters). Syntax - Num_of_columns(matrix) Example - Num_of_columns(matrix) = 3