Run code

The Run Code action node allows you to run Javascript code from your Apps towards third-party libraries. You may use Appfarm Data and Actions from the code.

Usage

You may add external Javascript libraries in Environment Config (Custom Header Tags). These libraries will be accessible from inside the Run Code.

Note that Run Code may run code asynchronously. In order to tell Appfarm when the code is finished running, you always need to finish the code with resolve() (or reject()).

If you want to run Actions from inside the Run Code, you must add the Action in the Actions list of the right-side property pane of the Run Code action node. Once added, you may find the Action in the Built in Function Params section of the Run Code function editor. Example: Having an Action Read Projects added to the Run Code, defined with Function Name readProjects, you may trigger it from inside the code by writing readProjects().

An example setup of Run code is showcased in our Showroom. You may view a demo as well as access the setup in Appfarm Create. If you do not have access, you may register here.

Last updated