In some widgets, formulas can be used to generate the value of the widget, so that you can use dynamic values instead of a constant default value.
Input Box
Date & Time
Label
The calculation tab can be opened by clicking on Widget Property Settings .
In the calculation tab, you will see the ‘Default formula’ area where you can customize your formula.
You can click on any blank area under ‘Default Formula’ to add an operator. An operator is an element that forms part of the formula. There are 5 types of operators. Click the button of the type of operator you want to use.
Text
Any text, number or symbol hardcoded by App designer
Date
Any text, number or symbol hardcoded by App designer
Variable
System-defined variable
Variable
Built-in functions, used together with other operators
Variable
The value of a widget in the current page
For a Date & Time widget, there is one additional option in the calculation tab for DateTime data type.
A Date & Time widget has 3 data types, including Date, Time and DateTime. The DateTime data type has a timezone specifying the actual point of time in global matters, while others don’t.
When using a no-timezone Date type in the calculation formula of a has-timezone DateTime, this option provides extra control on the formula.
If a user with timezone GMT+8 and the calculation of a DateTime widget is a Date type with value 01/01/2025
✘ Compute Date Picker as 12:00 AM in current user's time zone when using in the calculation below.
01/01/2025 08:00 AM
01/01/2025 12:00 AM
✔ Compute Date Picker as 12:00 AM in current user's time zone when using in the calculation below.
01/01/2025 12:00 AM
31/12/2024 04:00 PM
After you click the ‘Text’ button, type your text, number or symbol in the input box and click apply.
A text operator is displayed in black color.
After you click the ‘Date’ button, choose a date from the calendar and specify the time. By clicking the ‘Clock’ button on the left of the ‘Confirm’ button, the calendar shows you the current date and time. After finishing, click ‘Confirm’.
A date operator is displayed in orange color.
The format of a date operator is in a DateTime data type. If it is used on an Input Box String, it will be displayed as a timestamp in milliseconds. If you want to display the year/month/day/time of the date operator in a string, use it together with a function operator.
After you click the ‘Variable’ button, choose an operator from the list. You can search for an operator by typing in the input box.
A variable operator is displayed in red color.
Here are the definition and example of variable operators:
Now()
The current date and time during Run Time, in the format of DateTime data type.
Formula: MONTH(Now())
Display Value: The current month in number during Run Time
Empty()
Make the field become empty during Run Time.
Formula: Empty()
Display Value:
NewLine()
Break the content into a new line.
Formula: A + NewLine() + B
Display Value:
A
B
TimeZone()
The current user timezone during Run Time.
Formula: TimeZone()
Display Value: 28800 (GMT +08:00)
Environment ID()
The current Environment ID during Runtime.
Formula: Environment ID()
Display Value: developing (In Developing Environment)
Function Operator
After you click the ‘Function’ button, choose an operator from the list. You can search for an operator by typing in the input box.
The function operator is displayed in green color.
Here are the definition and example of function operators:
Plus (for integer/ decimal data type) or
And (for string data type)
(For string data type, values of the operator(s) will be concatenated
Formula: 12+6
Display value: 126 (in string data type) / 18 (in integer data type) / 18.00 (in decimal data type)
Minus
Formula: 18-6
Display Value: 12 (in string/integer data type) / 12.00 (in decimal data type)
Multiply by
Formula: 2*5
Display Value: 10 (in string/integer data type) / 10.00 (in decimal data type)
Divide by
Formula: 10/5
Display Value: 2 (in string/integer data type) / 2.00 (in decimal data type)
Comma
(It must be used together with other operators)
Open bracket
(It is used to separate operators clearly and operators in a bracket will be prioritized)
Formula: (9-5)*3
Display Value: 12 (in string/integer data type) / 12.00 (in decimal data type)
Close bracket
(It is used to separate operators clearly and operators in a bracket will be prioritized)
Formula: (9-5)*3
Display Value: 12 (in string/integer data type) / 12.00 (in decimal data type)
Divide by and show the remainder
Formula: 19MOD5
Display Value: 4 (in string/integer data type) / 4.00 (in decimal data type)
Round up to the nearest integer
Formula: CEILING(99.1)
Display Value: 100 (in string/integer data type) / 100.00 (in decimal data type)
Round down to the nearest integer
Formula: FLOOR(99.9)
Display Value: 99 (in string/integer data type) / 99.00 (in decimal data type)
Take the absolute value
Formula: ABS(-1)
Display Value: 1 (in string/integer data type) / 1.00 (in decimal data type)
Round off to the nearest integer
Formula: ROUND(2.5)
Display Value: 3 (in string/integer data type) / 3.00 (in decimal data type)
Randomly generate a number between 2 numbers, all inclusive
Formula: RAND(1,10)
Display Value: 3 (in string/integer data type) / 3.00 (in decimal data type)
Count the number of characters, including space, of an Input Box with String type
Formula: LEN(Dragonce)
Display Value: 8 (in string/integer data type) / 8.00 (in decimal data type)
Add a number of years to a Date value
Formula: AddYear(06/12/2025 03:00 PM,3)
Display Value: 06/12/2025 03:00 PM (in DateTime data type)
Add a number of months to a Date value
Formula: AddMonth(06/12/2025 03:00 PM,1)
Display Value: 06/01/2026 03:00 PM (in DateTime data type)
Add a number of day to a Date value
Formula: AddDay(06/12/2025 03:00 PM,1)
Display Value: 07/12/2025 03:00 PM (in DateTime data type)
Add a number of hour to a DateTime value, result displayed in DateTime data type
Formula: AddHour(06/12/2025 03:00 PM,1)
Display Value: 06/12/2025 04:00 PM (in DateTime data type)
Add a number of minute to a DateTime value, result displayed in DateTime data type
Formula: AddMinute(06/12/2025 03:00 PM,1)
Display Value: 06/12/2025 03:01 PM (in DateTime data type)
Add a number of second to a DateTime value, result displayed in DateTime data type
Formula: AddSecond(06/12/2025 03:00 PM,60)
Display Value: 06/12/2025 03:01 PM (in DateTime data type)
The end day of a month of a Date/DateTime value
Formula: EOMONTH(06/12/2025)
Display Value: 31/12/2025 (in Date data type)
The start day of the month of a Date/DateTime value
Formula: SOMONTH(06/12/2025)
Display Value: 1/12/2025 (in Date data type)
The year of a Date/DateTime value
Formula: YEAR(06/07/2025 03:00 PM)
Display Value: 2025 (in string/integer data type) / 2025.00 (in decimal data type)
The month of a Date/DateTime value
Formula: MONTH(13/07/2025 03:00 PM)
Display Value: 7 (in string/integer data type) / 7.00 (in decimal data type)
The day of a Date/DateTime value
Formula: DAY(13/07/2025 03:00 PM)
Display Value: 13 (in string/integer data type) / 13.00 (in decimal data type)
The hour of a Date/DateTime value in 24-hour time system
Formula: HOUR(06/07/2025 03:00 PM)
Display Value: 15 (in string/integer data type) / 15.00 (in decimal data type)
The minute of a Date/DateTime value
Formula: MINUTE(06/07/2025 03:00 PM)
Display Value: 0 (in string/integer data type) / 0.00 (in decimal data type)
The second of a Date/DateTime value
Formula: SECOND(Now())
Display Value: The second of the current time when the widget is first loaded
The number of the day of a Date/DateTime value in a week
(Ranging from 1 to 7, starting from Monday)
Formula: WEEKDAY(01/01/2025 03:00 PM)
Display Value: 3 (in string/integer data type) / 3.00 (in decimal data type) (Meaning Wednesday)
The number of the week of a Date/DateTime value in a year
Formula: WEEKNUM(01/01/2025 03:00 PM)
Display Value: 1 (in string/integer data type) / 1.00 (in decimal data type) (Meaning this date is in the 1st week in year 2025)
The number of Saturday between two Date/DateTime values, all inclusive
(The first parameter must be the earlier date)
Formula: NumOfSat(Date1,Date2)
Display Value: The number of Saturday in between the date in ‘Date1’ and the date in ‘Date2’ (in string/integer/decimal data type)
The number of Sunday between two Date/DateTime values, all inclusive
(The first parameter must be the earlier date)
Formula: NumOfSun(Date1,Date2)
Display Value: The number of Sunday in between the date in ‘Date1’ and the date in ‘Date2’ (in string/integer/decimal data type)
Convert milliseconds into number of days
Formula: SecToDay(86400000)
Display Value: 1 (in string/integer data type) / 1.00 (in decimal data type)
Convert a DateTime value to Date value only
Formula: DTtoDate(06/07/2025 03:00 PM)
Display Value: 06/07/2025 (in Date data type)
Convert a DateTime value to Time value only
Formula: DTtoTime(06/07/2025 03:00 PM)
Display Value: 03:00 PM (in Time data type)
The number of user or group chosen in a ‘User & Group’ widget
(The number of users in a group will not be counted)
Formula: CountStaffPicker(Staff)
Display Value: The number of user or group chosen in the ‘User & Group’ widget (in string/integer/decimal data type)
Make up or truncate a number to a certain number of digit
Formula: FillLenWithZero(5,3)
Display Value: 005 (in string data type)
Formula: FillLenWithZero(54321,3)
Display Value: 321 (in string data type)
Convert 1-12 to the short form of the respective month
Formula: toMon(Month(01/01/2025 03:00 PM))
Display Value: Jan
Convert 1-12 to the full form of the respective month
Formula: toMonth(Month(01/01/2025 03:00 PM))
Display Value: January
Convert a string value to UPPERCASE
Formula: toUpper(example)
Display Value: EXAMPLE
Convert a string value to lowercase
Formula: toLower (EXAMPLE)
Display Value: example
Extract certain numbers of characters from a string
Formula: SubString(Example,3)
Display Value: Exa
Formula: SubString(Example,-3)
Display Value: ple
Extract a positive number of characters from the left side of a string
Formula: Left(Example,3)
Display Value: Exa
Extract a positive number of characters from the right side of a string
Formula: Right(Example,3)
Display Value: ple
Find the position of the first variable that exactly matches in the second variable, counting from 1 and return -1 if not found
Formula: Find(Example,AnExample)
Display Value: 3
Formula: Find(example,AnExample)
Display Value: -1
Find the position of the first variable that exactly matches in the second variable, counting from 0 and return -1 if not found
Formula: IndexOf(Example,AnExample)
Display Value: 2
Formula: IndexOf(example,AnExample)
Display Value: -1
Remove the leading and trailing whitespace
Formula: Trim( a b )
Display Value: a b
Return the User Name of a selected user configured in Admin Panel
Formula: GetUserName(Staff)
Display Value: Alice Chow
Return the login email of a selected user
Formula: GetUserLogin(Staff)
Display Value: alicechow@company.com
Return the contact email of a selected user
Formula: GetUserContactEmail(Staff)
Display Value: alicechow@company.com
Return the direct line of a selected user
Formula: GetUserDirectLine(Staff)
Display Value: 31234567
Return the mobile phone of a selected user
Formula: GetUserMobilePhone(Staff)
Display Value: 61234567
Return the user description of a selected user configured in Admin Panel
Formula: GetUserDescription(Staff)
Display Value: Sales Department
Return the user title of a selected user configured in Admin Panel
Formula: GetUserTitle(Staff)
Display Value: Manager
Return the user grade of a selected user configured in Admin Panel
Formula: GetUserGrade(Staff)
Display Value: G7
Return the user status of a selected user
Formula: GetUserStatus(Staff)
Display Value: ACTIVE (when it is an active account)/ SUSPENDED (when it is a suspended account)
Return the user ID of a selected user configured in Admin Panel
Formula: GetUserID(Staff)
Display Value: S018
Return the raw user ID of a selected user provided by the system
Formula: GetRawID(Staff)
Display Value: u1234567890
After you click the ‘Widget’ button, choose a widget from the list. You can search for a widget by typing in the input box.
The function operator is displayed in blue.
(Form Name) unique key
The distinct record ID of a form
(Form Name) unique key
1204
Table Name (count)
The number of records on a table, included for “Form Table”, “Reference Table”, “SubForm”,
“SubForm Table”
Table Name (count)
5
Widget Name
Available to select for “Input Box”,
“Date & Time”,
“User & Group”
Available to locate in
“Form”,
“Page”,
“Value Stock”