We have support for Javascript in both our Integration Apps and Integration Steps. This means you have full control over the data and can do whatever data transformation you want and even make other transactions during the execution of an Action on an App.

We have 4 different scripting options for you:

  1. Before an Step in an Integration is executed
  2. Before an Action is executed on an App
  3. After an Action has been executed on an App
  4. After the Step in an Integration has been executed

Each script saves and uses variables from other steps and scripts.

https://www.copyl.com/wp-content/uploads/image-22.png

How Scripting Works

Each integration consists of one or more steps. The first step can have a trigger and one action. The rest of the steps only have actions. Each step executes a script before the action is executed, and after the execution.

Also, before an action is executed, the action’s own start script is executed. After the executed action, another script is executed. The scripts can modify the data that is sent to and from the action, and return a value other steps can use.

Your scripts must contain a main function with one argument and it must return something (or null).

function main(arg) {
	return "Hello World!";
}

What is possible to do in Copyl’s scripting engine?

In Copyl, you can write scripts using a subset of the JavaScript language. Initially based on the ECMAScript 5.1 standard, Copyl now supports many features from ECMAScript 6 (ES6) and later versions, enhancing its scripting capabilities. This allows you to use a wide range of JavaScript features, including:

Supported JavaScript Features

Limitations

Despite these enhancements, there are some limitations to be aware of:

Useful functions

UUID Generator

function generateUUID() { 
    var d = new Date().getTime(); // Current timestamp
    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
        var r = (d + Math.random() * 16) % 16 | 0;
        d = Math.floor(d / 16);
        return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16);
    });
}

Specialized functions for your integration logic

Copyl has a lot of specialized functions for file management, integration orchestration and data transformation.

HTTP REST

File Management

File Management – FTP

File Management – SFTP

Step and Integration flow control

Secrets

Logging

Email

Data Transformation