Using Axel-f functions

Xapix has developed an extensive set of functions called Axel-F functions that combine the most understandable syntax from Excel© and the speed of the programming language Clojure. These functions have a syntax similar to Excel formulas and other spreadsheet functions. However, unlike spreadsheet functions, they do not include cell references.

Axel-F functions can be used in combination with references and operators. They also include additional functions to work with lists such as MAP, FILTER, SORT, LENGTH and CONCAT, as well as Lambda (anonymous) functions, such as FN.

Example

To take a simple example, let's use a CONCATENATE function with references to two attributes to generate a third value based on those references.

CONCATENATE(data.vehicle_1.make, "-", data.vehicle_1.vin)

where:

  • Axel-F function - CONCATENATE

  • Attributes - data.vehicle_1.make and data.vehicle_1.vin

  • Operator - "-"

Entering Axel-f functions in the Formula editor

Xapix provides aids to entering formulas in the Formula editor:

  • Function auto-completion: When you start typing a function in a formula field, Xapix will suggest functions. When you enter a letter in the formula field, you are given suggestions to auto-complete the formula. For example, entering in the formula editor the letter C shows a list of all function beginning with c such as CONCAT(), CONCATENATE() and so on.

  • Syntax errors: Any errors made in syntax are indicated by a warning such as "Error parsing formula", etc. If there are no errors, a "Formula valid" message appears with an accompanying check mark.

  • Preview of next level elements - By entering the unit name for which you are mapping to the selected unit, a JSON preview and a list of available next level elements are provided. This serves as a hint as to which properties can be added as the next level. For example, request.query.destination.

  • Built-in Help text - Links to help text is available for each function.

List of functions in the Formula editor appear when editing a data sample for a data source or flow unit. They do not appear for Requests.

Creating custom parameters

Using Axel-f function, you can create custom parameters.

For example, suppose an endpoint has two body parameters: first_name and last_name. Using the CONCATENATE function, you can create a third parameter called full_name.

These are the references for the two attributes we use to create the third parameter:

  • getdriversbyid.body.data.first_name

  • getdriversbyid.body.data.last_name

We can now create the new parameter called full_name using the following formula:

CONCATENATE(getdriversbyid.body.data.first_name," ",getdriversbyid.body.data.last_name)