Script

×

REQUEST FREE TRIAL

Share A Little Information To Request Free Trial

Created with Sketch.
REQUEST FREE TRIAL

Overview

The Script connector can be used to add JavaScript functions to your workflows.  You can choose from the Operation dropdown whether you want to execute your step synchronously or asynchronously.  You should nearly always choose synchronously, unless you're planning to make HTTP requests from your script.

When you add a new Script connector to your workflow it comes with some example variables and an example script.  You can change the variables to anything you want.  Within your script variables are referenced using input.name. In the example below the variable foo with the value bar can be referenced by input.foo - you can see in the example that this is being used here to return this variable.  Any variable that you return in a script is available to be used in other connectors.

When writing scripts only replace the line return input.foo; in the example script.  The function declaration is required to make the script run properly.

JS Libraries

The Script connector supports some helpful JavaScript libraries which you can use in your script.

Library Link
lodash https://lodash.com/
mout http://moutjs.com/
request https://github.com/request/request
moment https://momentjs.com/

Last updated 11th May 2017

REQUEST FREE TRIAL

Share A Little Information To Request Free Trial

Created with Sketch.