Core Functions

Estimated reading time: 23 min
wiresk core function Core Functions
All functions available in Wiresk can be used with any subscription plan without any usage limitations.

These functions are like those found in SQL or other programming languages, and they are used for data manipulation, transformation, and calculations within your Flows. When mapping data, you can use functions to create complex formulas. 

Technically, it uses SQLite as its formula calculation engine. This provides a syntax that is quite familiar to those accustomed to spreadsheet software like Excel.

Functions cover a wide range of use cases, including: 

  • Mathematical operations (e.g., abs, round, random) 
  • String manipulation (e.g., concat, substr, replace) 
  • Conditional logic (e.g., if, coalesce, nullif) 
  • Data type conversion (e.g., hex, unhex, typeof) 
  • System utilities (e.g., changes, last_insert_rowid) 

Besides using Functions, Wiresk supports basic mathematical operations like addition (+), subtraction (-), multiplication (*), and division (/), allowing you to perform calculations directly within your Flows.

For instance, to calculate the total price, you would enter {{excl. tax price}} * (1 + {{tax rate}} ), where the values in brackets need to be Mapped from Wiresk data source or step response.

⚠️ Note: In SQLite, when you use the division operator with two integers, it performs integer division, meaning it only keeps the whole number part of the result and discards any decimal portion. 
For example, if you divide 7 / 3, SQLite will return 2 instead of 2.333333… because both numbers are treated as integers. 
To ensure that SQLite returns a decimal result, you need to convert at least one of the numbers into a floating-point (decimal) type. You can do this in two ways: 

  • Using CAST(7 AS REAL), which explicitly converts 7 into a floating-point number before performing the division. 
  • Multiplying 7 by 1.0, as in 1.0 * 7, which forces SQLite to treat 7 as a floating-point number, making the division return a decimal result.

By converting at least one of the numbers to a floating-point type, SQLite will perform standard division instead of integer division. This ensures that 7 / 3 correctly returns 2.333333… rather than just 2. 

You can manually enter Functions or basic mathematical operators during Method Setting.

To use data from your Flow, type “@” within the function input field. This will display a list of available data fields. Select the desired field to include in your formula.

Example: Transform GrabFood price to Youding price format.

This involves using functions within your Wiresk Flow to process and map the relevant order information.

Flow: Create an order in Youding based on the details of a new order received from GrabFood.

  • In Youding Method “Create Order”, Map the products from GrabFood’ order data.
  • Map the field “Unit price” to Youding system with the right price format. GrabFood use a price format with a Exponent 2 (The log base 10 of the number of times we have to multiply the major unit to get the minor unit.)
Screenshot of Wiresk Flow Builder, showing a Youding X Grab - create order Flow. Red arrows point to lightning bold icon for functions manual input field. Its show an example of the use case of ROUND function.
  • Use the ROUND(X,Y) function to obtain the price, where X represents the price value and Y specifies the number of decimal places to round to.

For example:

=ROUND( lo. price * lo. quantity * 1.0 / power(10, In. currency.exponent )) / 2 Exchange_Rate.Exchange_Rate, 2)

Where the values of lo. price, lo. quantity , In. currency.exponent, Exchange_Rate.Exchange_Rate need to be Mapped from Wiresk Triggers or Methods by typing “@“.

  • Define this field as a Formula Interpolation by selecting the 3 dots next to the lightning bold button.
Screenshot of Wiresk Flow Builder, showing a Youding X Grab - create order Flow. Red arrows point to three dot menu and to the selection of the Formula interpolation option.

When working with data mapping in Wiresk, you may encounter cases where a field is sometimes missing or contains NULL values. In such cases, you can use the IFNULL(X,Y) function to replace NULL values with a default value.

Example: Handling Missing Discount Values

Suppose you are processing an order where the discount amount may be missing. You can ensure a default discount of 0 using:

IFNULL({{order.discount}}, 0)

Here, if {{order.discount}} is NULL, the function will return 0. Otherwise, it will return the actual discount value.

Use Case in a Formula

To calculate the final amount after applying the discount, you can use:

{{order.total_price}} - IFNULL({{order.discount}}, 0)

This ensures that even if the discount is missing, the calculation proceeds without errors.

Perform various calculations and mathematical operations on data. These functions can be helpful for data manipulation, transformations, and handling numeric operations within your Flows. For more advanced functions refer to Mathematical functions.


The String Functions in Wiresk are used to manipulate and transform text-based data within your Flows. These functions allow for various operations such as concatenation, extraction, replacement, and case transformations.


Return specific values based on conditions or logical expressions. These functions are crucial for handling different scenarios, such as checking if certain conditions are met and then performing different actions based on those conditions.


Used for evaluating relationships between values and making decisions based on those evaluations. These functions enable you to compare data, check for patterns, and control the flow of data in your logic.


Provide information about the database and perform various system-level tasks, such as managing changes, retrieving metadata, and interacting with external systems or extensions. These functions are useful for tracking the state of your database, working with extensions, and more.


Group of diverse functions that don’t fall under the other categories like mathematical, string, or conditional functions. These are used for a variety of tasks such as handling binary data, generating hashes, and working with encoding/decoding schemes.


See more about functions in Wiresk. 
Explore our User Guide
For a complete tutorial on how to create a Flow, see “How to create a Flow in Wiresk”