Tabula Documentation
Tabula HomeCommunity
  • 👋Introduction to Tabula
  • Getting Started
    • Product Updates
    • Getting Started
      • Installation and Login
      • Beginner's Guide
    • FAQ
  • Product overview
    • Home Page
    • Exploring Data
      • Data Catalog
      • Exploring Datasets
      • Statistics Panel
    • Designing Flows
      • Creating Flows
      • Flow Designer Guide
        • Working with Canvas
        • Using Groups
        • Working with Table
      • Managing Flows
      • Sharing Flows
      • Demo: Building a Simple Flow
    • Executing Flows
      • Running Flows
      • Jobs overview
    • Building Reports
      • Designing Reports
      • Running Reports
      • Reports Page
    • Connecting Data
  • Integrations
    • Enrichments
      • How to add your API key in Tabula
      • List of Supported Queries
      • Enrichment Providers
        • AnymailFinder
        • Apollo
          • How to find Apollo API key
          • Enrich person by LinkedIn
          • Enrich company by domain
        • Bounceban
        • Bouncer
        • Bouncify
        • CaptainVerify
        • Cleanify
        • Clearout
        • CompanyEnrich
        • ContactOut
          • How to find ContactOut API key
          • Enrich person by LinkedIn
          • Enrich person by email
        • Discolike
        • TheCompaniesAPI
        • Findymail
        • Emailable
        • EmailListVerify
        • Enrichley
        • Heybounce
        • Hunter
        • Kickbox
        • Mails
        • MailChecker
        • MillionVerifier
        • NeverBounce
        • Nubela (Proxycurl)
        • PeopleDataLabs
        • Prospeo
        • ZeroBounce
        • ReverseContact
          • How to find Reverse Contact API key
          • Enrich person by LinkedIn
          • Enrich person and company by email
          • Enrich company by domain
          • Enrich company by LinkedIn
        • UpLead
    • Data Sources
      • Configuring Fivetran Integration
    • Data Storages
      • PostgreSQL
      • Snowflake
      • BigQuery
      • ClickHouse
  • Data Transformation
    • Transforms
      • Source
      • New Empty Table
      • Output
      • Chart
      • Enrichment
      • New Column
      • If...Then
      • Rolling Functions
      • Column Type
      • Columns Edit
      • Filter
      • Remove Duplicates
      • Sort
      • Find and Replace Text
      • Split Column
      • Extract Text
      • Match Text
      • Join
      • Union
      • Group By
      • Pivot
      • Unpivot
      • To JSON
      • From JSON
      • API Call
      • AI Column
      • AI Table
    • Formulas
      • What are Formulas?
      • Math Functions
        • Abs
        • Ceiling
        • Exp
        • Floor
        • IsEven
        • IsOdd
        • Ln
        • Log
        • Log10
        • Mod
        • Pi
        • Power
        • Quotient
        • Round
        • RoundDown
        • RoundUp
        • Sign
        • Sqrt
        • Truncate
      • Trigonometric Functions
        • Acos
        • Asin
        • Atan
        • Atan2
        • Cos
        • Cot
        • Degrees
        • Radians
        • Sin
        • Tan
      • String Functions
        • Compare
        • Concat
        • Contains
        • In
        • CountMatches
        • CountMatchesRegexp
        • EndsWith
        • EndsWithRegexp
        • Extract
        • FindMatchOfString
        • FindMatchOfRegexp
        • FindMatchesOfString
        • FindMatchesOfRegexp
        • Left
        • Length
        • Lower
        • Matches
        • Pad
        • ProperCase
        • RemoveSymbols
        • RemoveWhitespaces
        • Repeat
        • Replace
        • ReplaceRegexp
        • Reverse
        • Right
        • Spaces
        • Split
        • SplitRegexp
        • StartsWith
        • StartsWithRegexp
        • Stuff
        • Substring
        • SubstringDelimiter
        • SubstringRegexpDelimiter
        • Trim
        • Upper
      • Date & Time Functions
        • Date
        • DateAdd
        • DateAdd2
        • DateDiff
        • DateDiff2
        • DateFromParts
        • DateTime
        • DateTimeFromParts
        • DateTrunc
        • DayName
        • DayOfMonth
        • DayOfWeek
        • DayOfYear
        • Hour
        • Minute
        • Month
        • MonthName
        • Now
        • Quarter
        • Second
        • Time
        • TimeFromParts
        • Today
        • Week
        • Year
      • Aggregate Functions
        • Any
        • AnyIf
        • Array
        • ArrayIf
        • Avg
        • AvgIf
        • AvgInRow
        • Count
        • CountA
        • CountIf
        • CountUnique
        • Max
        • MaxIf
        • MaxInRow
        • Median
        • MedianIf
        • Min
        • MinIf
        • MinInRow
        • Mode
        • ModeIf
        • Percentile
        • Quartile
        • StdDev
        • StdDevIf
        • Sum
        • SumIf
        • SumProduct
        • Variance
        • VarianceIf
      • Conversion Functions
        • ToArray
        • ArrayToString
        • ToBoolean
        • ToDate
        • ToDateTime
        • ToDecimal
        • ToInteger
        • ToObject
        • ToTime
        • ToString
      • Misc Functions
        • At
        • IsMissing
        • RowNumber
        • Random
        • If
        • Coalesce
        • True
        • False
        • Null
        • $target
      • Window Functions
      • Custom Functions
      • Data Types
      • Supported Date Parts
      • Regex: List of Tokes
  • Pricing & Billing
    • Plans, Subscriptions, and Credits
    • Tabula for Education
  • Tutorials
    • Tabula Use Cases
    • Merge Columns
    • Join Types
    • Union Introduction
    • Window Functions
    • What is Unpivot?
    • JSON Format Tutorial
    • Using Regex
Powered by GitBook
On this page
  • Introduction
  • Creating a Custom Function
  • Tips and Best Practices

Was this helpful?

  1. Data Transformation
  2. Formulas

Custom Functions

PreviousWindow FunctionsNextData Types

Last updated 11 months ago

Was this helpful?

Introduction

In Tabula.io, users can create and utilize custom functions to enhance their data manipulation capabilities. While the platform lacks a direct user interface for this feature, custom functions can be easily implemented through a JSON configuration.

Creating a Custom Function

1. Define the Function in JSON Format.

Custom functions are defined in a specific JSON structure. Use the following template for a custom function and save it as YourFunctionName.json file:

jsonCopy code{
  "signature": {
    "name": "FunctionName",
    "typeParameters": [],
    "valueParameters": [
      {
        "name": "Parameter1",
        "typeSet": [{"type":"PrimitiveType","name":"String"}],
        "argumentDescription": "Parameter1 description"
      },
      {
        "name": "Parameter2",
        "typeSet": [{"type":"PrimitiveType","name":"String"}],
        "argumentDescription": "Parameter1 description"
      }
    ],
    "returnType": {"type":"PrimitiveType","name":"String"}
  },
  "body": "FindMatchOfRegexp(Parameter1, \"(?<=\\?\" | Parameter2 | \"=|&\" | Parameter2 | \"=)[^&#]*\", false)",
  "description": "Function description"
}

2. Fill template parameters

Function Name:

name: Enter the name of your custom function.

Function Parameters (Arguments):

valueParameters: List the parameters your function will use.

  • name: Specify the name of each parameter.

  • typeSet: Define the type of each parameter. Possible types include String, Integer, Double, Date, DateTime, Time, Object, Array, and AnyType.

  • argumentDescription: Describe each parameter to explain its purpose and usage.

Return Type:

returnType: Indicate the type of value your function returns. Options include String, Integer, Double, Date, DateTime, Time, Object, Array, AnyType.

Function Description:

description: Write a brief description of what your function does and its intended use.

Function Body (Expression):

body: Input the expression that defines your function's logic. It's recommended first to test the expression using the New Column node for validation, then copy it to the file. Remember to add additional escape characters (\) before quotes (") and backslashes (\) in the expression.

For instance, an email validation expression in the New Column node might be:

 Matches(EmailColumnName, "^[a-z0-9.!#$%&‘*+/=?^_`{|}~-]+@[a-z0-9-]+(?:\.[a-z0-9-]+)*\.[a-z]{2,}$", false)

In the JSON file, it should be formatted as:

"body": "Matches(EmailColumnName, \"^[a-z0-9.!#$%&‘*+/=?^_`{|}~-]+@[a-z0-9-]+(?:\\.[a-z0-9-]+)*\\.[a-z]{2,}$\", false)"

3. Saving and Using the Custom Function

Save the File: Store the JSON file in the appropriate directory:

  • For Mac OS: /Users/%username%/Library/Application Support/tabula/latest/udfs

  • For Windows: C:\Users\%username%\AppData\Roaming\tabula\latest\udfs

Replace %username% with your actual username.

4. Restart Tabula

After saving the file, restart the Tabula application for the custom function to be recognized and available.

Tips and Best Practices

  • Thorough Testing: Before implementing your custom function in critical data flows, test it extensively to ensure it behaves as expected.

  • Clear Naming Conventions: Use clear and descriptive names for your functions and parameters for easy understanding and maintenance.

  • Comprehensive Descriptions: Provide detailed descriptions for your functions, outlining their purpose and how they work, to assist other users.

463B
IsEmail.json
Custom function example