• search
  • Contact Sales
  • Support
    • Online Help
    • Community Forum
    • Contact Support
  • Log in
Get a Demo Try Free
High Contrast
Caspio logo Help
Try Free
  • High Contrast
  • search
  • Contact Sales
  • Support
    • Online Help
    • Community Forum
    • Contact Support
  • Log in
Get a Demo Try Free
  • Help Center
  • Manage and Organize Your Data
  • Data Types
  • Function Reference
  • Launch Your Caspio Journey
  • Create Applications
    • Applications Overview
    • Creating Apps With Bridge
      • Bridge App Overview
        • Creating a New App Container
        • Importing an App
        • Exporting an App
        • Deleting an App
        • Shared Objects
        • Backing Up Your Applications
        • Sharing an App with Another Account
        • App Parameters
          • Adding App Parameters
          • Managing App Parameters
          • Using App Parameters
      • Authentication
        • Setting Up User Permissions in Your App
        • Adding a Logout Link
        • Record Level Security
          • Create a Workflow using Record Level Security and Filtered Dropdown
          • Restrict Access to Data by User or Role
          • Filter Lookup Dropdown or Listbox Based on User or Role
        • Stamp a Record with User Profile Data
        • OpenID
        • Create a Standalone Login Screen
        • Hiding Multiple Login Forms
      • DataPages
        • What is a DataPage?
        • DataPage Types
        • Forms
          • Submission Forms
          • Update Forms
          • Password Recovery Forms
          • Form Element Types
          • Conditional Forms
          • Child Forms
          • Accepting Payments in Your Application
        • Reports
          • Creating a Report DataPage
          • Comparison Types in Report DataPages
          • Search by Distance
          • Report Page Results Layout
          • Interactive Reporting Options
          • Pivot Table Reports
          • Counting the Number of Times a Record Has Been Viewed
          • Display a Field Data as Hyperlink
          • Fixed Rows and Columns
          • Making the Search Results Downloadable as PDF
          • Editing Data Through My Details Page
          • Making the Details Downloadable for Users
          • Data Editing Options in Reports
          • Combined Chart and Report
          • Adding “Today” to “After Now” or “Next X Days” Criteria
          • Filtering Reports Based on an Expiration Date
          • Advanced Reporting
            • Calculations in Reports
            • Data Grouping
            • Totals and Aggregations
            • Calculated Fields and Datediff Function
        • Charts
        • Calendars
          • Calendar DataPage – Monthly Example
          • Calendar DataPage – Weekly Example
        • HTML Pages
        • DataPage Components
          • Dropdowns and Listboxes
          • Cascading Elements
          • Calculated Values
          • Field Configuration Options
            • Field and Column Width
            • Placeholder Text
            • Rollover Hints – Mouse-Over Help Icon
            • Image Auto-Rotation
          • DataPage Header and Footer
          • HTML Blocks
          • Disabling HTML Editor in DataPage Header/Footer and HTML Blocks
          • Field Formatting Options
          • Custom Date Formatting
          • Multi-column and Sections
          • CAPTCHA
          • Virtual Fields
          • Setting up Default Values
          • AutoComplete
        • Managing DataPages
          • Modifying DataPages
          • Previewing DataPages
          • Moving DataPages
          • Copying DataPages
          • DataPage Revisions
          • DataPage Folders
          • Exporting and Importing DataPages
          • Moving Existing DataPages To a New App
        • Responsive DataPages
          • Responsive DataPage Prerequisites
          • Responsive Behavior on Tablet and Mobile
          • Modifying Styles for Tablet and Mobile
        • AJAX Loading
        • PDF Download
          • Adding a text watermark
          • Adding an image watermark
          • Adding page breaks to details page
          • Adding header and footer
        • Best Practices in Creating Caspio Applications
      • Notifications
        • Email Notifications
          • Verifying Email and Domain
          • Configuring Email
          • Setting Up Dynamic or Conditional Notification Emails
        • SMS Notifications
          • Configuring the SMS-enabled Countries
          • Configuring SMS
          • Adding SMS Sender Name
      • Parameters
        • Parameter Types
        • System Parameters
        • Passing Parameters through Caspio
        • Displaying Parameters
        • Parameters as Query String Values
        • Receiving Parameters
        • Resetting Parameters
        • Passing Multiple Values in One Parameter
        • Formatting Parameters in Email Body and HTML Blocks
        • Parameters in Dropdowns, Listboxes and Radio Buttons
        • Custom Filter Elements
      • Connections
        • SAML Single Sign-On
        • Setting Up ID Services
      • Styles
        • Creating or Editing a Style
        • Layout Options
        • Fix the Width of the DataPage
        • Button Alignment
        • Field Alignment
        • Border Options
        • Using Google Web Fonts
        • Glossy Heading Text
        • Gradient Backgrounds for DataPages
        • Gradient Backgrounds for Fields
        • Replace Links to Records with Images
        • Replace Standard Buttons with Images
        • Change the Color of Field Error Labels
        • Change Text on a Button
        • Put Multiple Fields on One Line
        • Styling Advanced Reports
        • Add Rounded Borders to the Form and Fields
        • Use an Image as Form Background
        • Fix the Width of Labels and Data in List and Gallery Reports
        • Customize the ID Service Icon of the Login Screen
      • Localizations
        • Creating or Editing a Localization
        • Handling Arabic, Hebrew and Other Right-to-Left Languages
        • Formatting Options
        • Using Localization Feature to Improve Usability
        • Format Types
      • Files and Images
        • Uploading Files and Images
        • FileStor CDN
        • Managing Files
        • Bulk File Import and Export
        • Creating Thumbnails with the Image Resizer
        • Using Files in DataPages
        • Orphan File Cleanup
    • Creating Apps With Flex
      • Flex Overview
      • Roles
        • Creating New Roles
        • Adding Users and Groups to Roles
        • DataPart Display Based on the User Role
        • Editing Role Permissions
          • User’s Own Records
          • Custom Access
        • Removing Users and Groups from Roles
        • Deleting Roles
      • Application Design
        • Segments
          • Editing Segment Settings
          • Themes and Widgets
        • Adding AppPages
        • AppPage Types
        • Moving DataParts
        • Resizing DataParts
        • Adding DataParts
        • Forms
          • Form Elements
          • Search Form
          • Submission Form
          • Details/Update Form
        • Reports
          • Tabular Report
          • Card Report
          • Pivot Table
        • Sign-up Form
        • Charts
          • Creating and Configuring Charts
          • Chart Display Options
        • Text/HTML
        • Data Filters
          • Creating Filters
        • Calculated Values in Flex DataParts
        • Communication Between DataParts
        • Designing User-Friendly Navigation Between AppPages
      • Parameters
        • Inserting Parameters
        • Application Parameters
        • Adding Support for Lookup Values in Data Source Parameters
        • Stamping Records with User ID
      • Branding
      • Flex FAQ
  • Manage Users and Groups
    • Directories Overview
      • User Authentication in Directories
      • Converting Tables to Directories
      • Creating Directories
    • Directory Users
      • User Status Overview
      • Creating Users
      • Activating Users
      • Adding Users to Groups
      • Resetting User Passwords
      • Resetting Two-Factor Authentication
      • Suspending and Unsuspending Users
      • Changing User Sign-In Method
    • Directory Groups
      • Creating Groups
      • Modifying Groups
      • Deleting Groups
    • Directory Security
      • Session Management
      • Turning On Two-Factor Authentication
      • Customizing Directory Security Policy
      • Redirecting to Custom URLs After Sign-in and Sign-out
    • Directory User Portal
    • Directory Emails
    • Identity Providers
      • Adding Identity Providers
        • Tutorial: Adding Microsoft Entra ID (formerly Azure AD) Identity Provider
        • Tutorial: Adding Okta Identity Provider
        • Tutorial: Adding OneLogin Identity Provider
      • Editing Identity Providers
      • Deleting and Disabling Identity Providers
      • Configuring Single Logout
    • App Connections
      • Creating App Connections 
        • Authenticating Users to Caspio Apps in Multiple Accounts Using a Single Directory
        • Tutorial: Adding HubSpot App Connection
        • Tutorial: Adding BambooHR App Connection
        • Tutorial: Adding Slack App Connection
      • Managing App Connections 
      • Deleting and Disabling App Connections
  • Manage and Organize Your Data
    • Data Management Overview
    • Tables and Views
      • Creating Tables
      • Modifying a Table’s Design
      • Removing Blanks From a Dropdown or Listbox
      • Lookup Tables
      • Views
        • Creating a View to Filter Data
        • Creating a View to Join Tables
        • Self-Join Views
        • Modifying Views
        • Importing and Exporting Views
    • Data Types
      • List Data Types
      • Function Reference
      • Adding a Formula Field in a Table
      • Managing Files With the Attachment Data Type
    • Managing Data in Datasheet
      • Find and Replace Specific Values
      • Filtering Data
      • Downloading Table or View Data
    • Database Relationships
      • Relationship Settings
    • Importing Data
    • Exporting Data
    • Sharing Data Between Apps
    • Best Practices for Designing Databases and Tables
    • Logs
      • Managing Logs
        • Logs Retention Period
      • App Access Logs
      • Directory Logs
      • Email Logs
      • Integrations Logs
      • Payment Logs
      • SMS Logs
  • Leverage AI
    • AI Assistant Overview
  • Automate Tasks and Workflows
    • Automations Overview
    • Triggered Actions
      • Creating a Triggered Action
        • Actions
          • UPDATE
          • DELETE
          • INSERT INTO
          • SEND EMAIL
          • SEND SMS
        • Data
          • SELECT
        • Logic
        • Loops
        • Text
        • Number
        • Date
        • Variables
    • Tasks
    • Data Import/Export Tasks
      • Data Import Tasks
      • Data Export Tasks
      • Configuring a Repository Site
      • IP Addresses for Data Import/Export Tasks
      • Data Import/Export Tasks Tips and Best Practices
  • Generate PDF Documents
    • Document Generation Overview
    • Creating Templates
    • Mapping Fields in Templates
    • Template Field Types
    • Configuring Template Settings
      • Formatting Field Values
      • Adding Watermarks
      • Encrypting PDF Documents
      • Configuring PDF Document Properties
      • Changing PDF File for a Template
    • Enabling Document Generation in Applications
    • Managing Templates
  • Integrate and Extend Your Apps
    • Integrations Overview
    • Webhooks
      • Getting Started with Webhooks in Caspio
      • Webhooks Rules and Limitations
      • IP Addresses for Webhooks
      • Creating and Managing Webhooks
        • Configuring Call Throttling
      • Creating and Managing Events
        • Event Types
        • Activating or Deactivating Events
      • Testing Webhooks
    • Extensions
      • AI-Powered GPT Connect
      • Extension for Slack
      • QR Code Generator
      • Barcode Generator
    • Web Services API
      • Creating a Web Services API Profile
      • Authenticating REST API
      • Important Header Parameters
      • Special Considerations
      • Error Handling
      • Swagger UI
      • Migration from REST API v2 to v3
    • Integration with Make
    • Integration with Zapier
  • Deploy Your Apps
    • Deploying Bridge Apps
      • General Deployment Guide
      • Remove iFrame Border and Change Size
      • Block Access to DataPages by IP Address
    • Deploying Flex Apps
      • Mapping a Friendly Subdomain
  • Manage Account and Billing
    • Account Settings
    • Account Users, Groups and API Profiles
      • Inviting New Account Users
      • Creating Groups for Account Users
      • Managing Permissions
      • Changing Account Owner
    • Changing Your Plan
    • Updating Payment Information
    • Payment History
    • Custom Domain
    • Account Notifications
    • Resource Usage
    • Caspio ID
      • Managing Your Caspio ID
      • Forgot Your Password
      • Getting Support PIN
    • Support Login
    • Search for Objects
  • Videos
    • Bridge Videos
      • Build Your First App
      • Recorded Training
      • Customize Your Apps
      • Advanced Topics
      • Full App Implementation
      • Tips and Tricks
    • Flex Videos
      • Build Your First App
      • Recorded Training
  • Resources and Best Practices
    • Frequently Asked Questions (FAQ)
    • Tech Tips
    • Troubleshooting
      • Troubleshooting SMS Delivery
      • Troubleshooting Email Delivery and Domain Verification
      • Cannot Log in to My Caspio Account
      • Issue with Login to Apps or DataPages
      • Issue with Redirection After Logout
      • Acknowledgement Emails Are Not Received
      • Issues with Email Verification Code
      • JavaScript Does Not Work with Multiple DataPages
      • Cannot See an SSL Lock Icon for My Web Page
      • Responsive UI Does Not Display Properly
      • Date Fields from Excel Import Incorrectly
      • Troubleshooting Custom PDF Generator
      • Troubleshooting Data Import Speed
      • System Limitations
      • Errors and Messages
    • System Requirements
    • Deprecations
      • Deprecation of Twitter as an ID Service in Authentications and Connections
      • Deprecation of Google Drive for Data Import/Export Tasks
      • Deprecation of HTTP Deployment
      • Deprecation of the Option to Disable AJAX Loading
      • Deprecation of MS Access for Import/Export
      • Deprecation of Cb_ErrorLog Tables
      • Deprecation of Google Map Mashup Generator
      • Deprecation of Frame Deployment
      • Deprecation of .xls Excel Format for Data Import
      • Deprecation of SEO Deployment Method
      • Deprecation of WordPress Deployment
      • Deprecation of Unverified Email Addresses
      • Deprecation of SOAP Web Service
      • Deprecation of Internet Explorer 11 and Microsoft Edge Legacy Browsers
  • Release Notes
    • Caspio 60.0
    • Caspio 59.0
    • Caspio 58.0
    • Caspio 57.0
    • Caspio 56.0
    • Caspio 55.0
    • Caspio 54.0
    • Introducing Flex
    • Caspio 53.0
    • Caspio 52.0
    • Caspio 51.0
    • Caspio 50.0
    • Caspio 49.0
    • Caspio 48.0
    • Caspio 47.0
    • Caspio 46.0
    • Caspio 45.0
    • Caspio 44.0
    • Caspio 43.0
    • Caspio 42.0
      • Known Issue: Scrolling on macOS Devices
    • Caspio 41.0
    • Caspio 40.0
    • Caspio 39.0
    • Caspio 38.0
    • Caspio 37.0
      • Impacted Areas 37.0
    • Caspio 36.0
    • Caspio 35.0
    • Caspio 34.0
      • Impacted Areas 34.0
    • Caspio 33.0
    • Caspio 32.0
    • Caspio 31.0
      • Impacted Areas 31.0
    • Caspio 30.0
    • Caspio 29.0
    • Caspio 28.0
    • Caspio 27.0
    • Caspio 26.0
    • Caspio 25.0
    • Caspio 24.0
    • Caspio 23.0
    • Caspio 22.0
    • Caspio 21.5
    • Caspio 21.0
      • Impacted Areas 21.0
    • Caspio 20.0
    • Caspio 19.0
      • Impacted Areas 19.0
      • Security Patch 19.5
    • Caspio 18.0
    • Caspio 17.0
    • Caspio 16.0
    • Caspio 14.0
      • Impacted Areas 14.0
    • Caspio 15.0
    • Caspio 13.0
      • Caspio 13.0
      • Impacted Areas 13.0
    • Caspio 12.0
      • Impacted Areas 12.0
    • Caspio 11.0
      • Impacted Areas 11.0
    • Caspio 10.0
    • Caspio 9.9
      • Impacted Areas 9.9
    • Caspio 9.8
    • Caspio 9.7
    • Caspio 9.6
      • Impacted Areas 9.6
    • Caspio 9.5
      • Impacted Areas 9.5
    • Caspio 9.4
      • Impacted Areas 9.4
    • Caspio 9.3
      • Impacted Areas 9.3
      • Caspio 9.3
    • Caspio 9.2
      • Impacted Areas 9.2
    • Caspio 9.1
      • Impacted Areas 9.1
    • Caspio 9.0
      • Known Issues 9.0
      • Impacted Areas 9.0

Function Reference

6 minutes to read

The following functions, expressions and operators can be used as indicated in:

  • Calculated Fields available in report DataPages.
  • Aggregations available in report DataPages.
  • Formula field available in table design.
  • Calculated Value form elements in submission forms.

Math Functions

FunctionDescriptionExampleReturn
Abs(number)Absolute value of a number.Abs([@field:Number])Number
Acos(number)Arccosine of a number in radians.Acos([@field:Number])Number
Asin(number)Arcsine of a number in radians.Asin([@field:Number])Number
Atan(number)Arctangent of a number in radians.Atan([@field:Number])Number
Atn2(x-number, y-number)Arctangent of the specified x-coordinate and y-coordinate.Atn2([@field:X],[@field:Y])Number
Ceiling(number)A number rounded up to the nearest integer.Ceiling([@field:Amount])Number
Cos(number)Cosine of an angle.Cos([@field: Number])Number
Cot(number)Cotangent of an angle.Cot([@field: Number])Number
Degrees(number)Radians converted to degrees.Degrees([@field:Incline])Number
Exp(number)Constant “e” raised to the power of the given number.Exp([@field:Number])Number
Floor(number)Number rounded down to the nearest integer.Floor([@field:Amount])Number
Log(number)Natural logarithm of a number.Log([@field:Number])Number
Log10(number)Base -10 logarithm of a number.Log10([@field:Number])Number
Pi()Value of Pi.Pi()Number
Power(number, power)Number raised to a power.Power([@field:Number], 2)Number
Radians(number)Degrees converted to radians.Radians([@field:Number])Number

Rand()

Rand(number)

Returns a random number between 0 and 1 using an optional number as a seed.

When used in Formula Fields a seed is required.

Rand()

Rand([@field:Seed])

Number
Round(number, precision)Number rounded to the specified length of precision. A positive precision indicates the number of digits after the decimal point. A negative precision indicates digits before the decimal point.Round([@field:Margin], 1)Number
Sign(number)1, 0 or -1 if the number is positive, zero or negative, respectively.Sign([field:Number])Number
Sin(number)Sine of an angle.Sin([@field:Number])Number
Sqrt(number) Square root of a numberSqrt([@field:Number])Number
Square(number)Square of a number.Square([@field:Number])Number
Tan(number)Tangent of an angle.Tan([@field:Number])Number
IsNull(value, replace_value)Replaces NULL with the specified replacement value, otherwise returns the result of expression.IsNull([@field:Number], -0)Number
IsNumeric(expression)1 if expression is a valid number and 0 otherwise.IsNumeric([@field:Status])Integer

Text Functions

FunctionDescriptionExampleReturn
Charindex(string1, string2, start_location)Searches string2 for string1 and returns its starting position if found. The search starts at start_location.Charindex(‘John’, [@field:Full_Name], 0)Integer
Left(string, number)Left part of a character string with the specified number of characters.Left([@field:Subject], 2)Text
Len(string)

Number of characters in the string, without trailing space.

The function returns 2 for some Unicode characters.

Len([@field:Comment])Integer
Lower(string)String converted to lowercase.Lower([@field:Name])Text
Ltrim(string)String without leading spaces.Ltrim([@field:Comment))Text
Patindex(‘pattern’, string)Starting position of the first occurrence of a pattern in a specified string, or zeros if the pattern is not found.Patindex(‘10’, [@field:Student_ID])Integer
Replace(string1, string2, string3)Copy of string1, where all occurrences of string2 are replaced by string3.Replace([@field:Description], ‘United States’, ‘USA’)Text
Reverse(string)Reverse of the string.Reverse([@field:String])Text
Space(number)String of repeated spaces.Space(12)Text
Str(number, length , precision)Returns the number as a string, with a given length(default 10). Optional precision defines the number of digits after the decimal point, up to 16.Str([@field:Amount],10,16)Text
Stuff(string1, start, length, string2)Inserts a string into another string. It deletes a specified length of characters in the first string at the start position and then inserts the second string into the first string at the start position.Stuff([@field:Comment_1], 2, 3, [@field:Comment_2])Text
Substring(string, start, length)Returns a substring starting at the starting position defined by start, with total length defined by length.Substring([@field:Comment], 2, 2)Text
Upper(string)String converted to uppercase.Upper([@field:Flight_ID])Text
NullIf(expression1, expression2)First expression if the two expressions are not equal, otherwise a null value.NullIf([@field:Assigned_To],[@field:Executed_By])Text
NCasts a string to nvarchar SQL data type that supports Unicode data.N’Ausländer’Text

Date and Time Functions

FunctionDescriptionExampleReturn
DateAdd(datepart, number, date)New date which results from addition of specified number to datepart.DateAdd(day, 14, [@field:Signed_up_date])Date
DateDiff(datepart, startdate, enddate)Difference between the specified dateparts of two dates.DateDiff(year, [@field:Hired_Date], [@field:Resigned_Date])Integer
DatePart(datepart, date)

Specified part of the date. The following are acceptable values for datepart and sample return value:

datepartReturn value
year, yyyy, yy2007
quarter, qq, q4
month, mm, m10
dayofyear, dy, y303
day, dd, d30
week, wk, ww45
weekday, dw1
hour, hh12
minute, n15
second, ss, s32
millisecond, ms123
microsecond, mcs123456
nanosecond, ns123456700

TZoffset, tz

(requires ISO 8601 format)

310

Note: week, wk, ww, weekday, dw are not supported in the Formula field.

DatePart(year,[@field:Birthday])Integer
SysDateTime()

Current system timestamp

Note: Not available in the Formula field.

SysDateTime()Date
SysUTCDateTime()

Current system timestamp in UTC time.

Note: Not available in the Formula field.

SysUTCDateTime()Date
Day(date)Day of specified date.Day([@field:Birthday])Integer
Month(date)Month of specified date.Month([@field:Birthday])Integer
Year(date)Year of specified date.Year([@field:Birthday])Integer

Miscellaneous Functions and Expressions

FunctionDescriptionExampleReturn
Cast(expression/value AS new data type)Expression converted to desired data type.Cast([@field:Sale]) AS int)Depends on data type specified
Convert(new data type, expression/value)Expression converted to desired data type. See SQL documentation.Convert(int, [@field:Sale])Depends on data type specified
Try_Convert(new data type, expression/value)Returns converted value of the type specified if the expression can be converted into it, and Null otherwise.Try_Convert(datetime, [@field:dob])Depends on data type specified

FunctionDescriptionExampleReturn
CaseEvaluates a list of conditions and returns one of multiple possible result expressions.

CASE

WHEN [@field:Age] >= 65 THEN ‘Senior’

WHEN [@field:Age] >= 18 AND [@field:Age] < 65 THEN ‘Adult’

ELSE ‘Minor’

END

Vary
Select

Returns a results set of records from one or more tables.

Note: Not available in the Formula field.

SELECT Count(Country) FROM Customers WHERE Country=’Canada’Vary

Logical Operators such as ALL, AND, ANY, BETWEEN, EXISTS, IN, LIKE, NOT, OR and SOME are supported in CASE and SELECT statements.

Aggregation Functions

FunctionDescription
AvgAverage of all records values.
CountAdds 1 to the total for each record.
Count Non BlankAdds one to the total for each record that contains data.
MinSmallest value in specified field of a record set.
MaxLargest value in specified field of a record set.
SumSum  total of all record values.

Aggregate functions are only available in Aggregation Fields in report DataPages. They do not work in Calculated fields or Formula fields.

Scalar Functions (mathematical operations)

OperatorDescription
+Add
–Subtract
*Multiply
/Divide
%Modulo
&Bitwise AND
|Bitwise OR
^Bitwise XOR
~Bitwise NOT

Comparison Operators

Comparison OperatorDescription
=Equals
>Greater than
<Less than
>=Greater than or equal to
<=Less than or equal to
<>Not equal to
!=Not equal to
!<Not less than
!>Not greater than
  • PRODUCT

  • Platform Overview
  • Why Low Code
  • Case Studies
  • App Marketplace
  • Pricing
  • Get a Custom Demo
  • Free Trial
  • SOLUTIONS

  • Healthcare
  • Education
  • Government
  • Financial Services
  • Energy and Utilities
  • Nonprofits
  • Media
  • Consulting
  • RESOURCES

  • Resource Center
  • Blog
  • Free Training
  • Online Help
  • Onboarding
  • Get Certified
  • Professional Services
  • Support Center
  • COMPANY

  • Our Story
  • Careers
  • Leadership
  • News
  • Partner Programs
  • Referral Program
  • Academic Program
  • Discount Programs
  • Contact Us
  • TRENDING

  • Build Custom CRM
  • Create Web Dashboards
  • Best Online Database
  • Convert Excel to Web
  • Migrate MS Access Online
  • HIPAA Compliant Database
  • Create a Patient Portal
Caspio Logo

Caspio is the world’s leading cloud platform for building online database applications without coding.
Start a free trial today and experience the power of no-code.

Footer Partners

© 2025 Caspio, Inc. Sunnyvale, California. All rights reserved.

  • Privacy Statement
  • Terms of Use
  • Report Abuse
  • Feedback