runjsfunction-xif

RunJsFunction

Stable version 1.0.1 (Compatible with OutSystems 11)
Published on 07 November 2019 by 
5.0
 (1 rating)
runjsfunction-xif

RunJsFunction

Details
The RunJsFunction lets you run javascript on the serverside. There is no need to install anything on your server like NodeJs or a webbrowser. It uses the Jint engine (.net library) to perform javascript operations.
Read more

How it works:

There are 2 input parameters to this extension. “input” and “script”. Both should be as a plain string but “input” can be Json formatted. The result should be:

Input:
{
  "amount" : "3",
  "price" : "4"
}
Script:
input = JSON.parse(input);
input.total = (input.amount * input.price).toString();
input = JSON.stringify(input, null, "\t");
Output:
{
                "amount": "3",
                "price": "4",
                "total": "12"
}

 

Practical usages:

Although almost all logic can be performed by coding in OutSystems. This tool lets you create logic without the need to build and release. Scripts can be saved and retrieved from the database so that would be the only logic you need to build in OutSystems.

We currently use it to map one Json object to another. When working with a lot of structures this tool makes life a little easyer.

Implementation:

The RunJsFunction Editor will soon be available on the forge using CoreMirror as an IDE to write your scripts.

Resources:

https://archive.codeplex.com/?p=jint

What’s new (1.0.1)

edited a typo

Reviews (0)
More from Danny Prager