Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Javascript Functions

While many API automation tasks can be completed by invoking endpoints and passing identifiers from one service to another, many tasks require some data processing to correctly accomplish their goals. 

To assist in this, ACP offers the ability to include user-written Javascript functions to handle these data manipulation tasks.

Javascript Functions Management Screen

The Javascript Functions Management screen can be accessed from the left-hand menu by clicking on the pages icon, below User Management and above Generic Connectors.  

...

Each Javascript Function has a name, an optional category, and a description.  The Management screen contains fields to search for a given Function by name and to filter the results by category.  Click on an existing Function name to edit the Function.

Add Function

New Javascript Functions can be defined by hitting the ‘Add Function’ button at the top of the screen.

...

  • Each Function can accept an unlimited number of arguments and produces exactly one return value. 
  • Each Function can be of unlimited length and contain whatever logic is required to accomplish the Function’s goals.
  • All internal Javascript-native features are available, but no extensions or libraries.
  • Javascript Functions are used wherever a variable is required in an ACP Workflow.  They can be used to transform Required or Optional Input data, or in Conditions & Routing blocks, or anywhere else a variable type box is displayed.  

Using Functions

To use a particular Javascript Function, open the variable type drop-down and pick ‘function.’  Click the ‘select function’ box to bring up the Function Picker.

...