Created on 07 November 2019
icon_unfollowing
Login to follow
runjsfunction-xif

RunJsFunction

Stable version 1.0.2 (Compatible with OutSystems 11)
Uploaded on 01 December 2022 by 
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

Release notes (1.0.2)

Input is working now

Reviews (0)
Category
Integrations, Data
Tags
Support options
This asset is not supported by OutSystems. You may use the discussion forums to leave suggestions or obtain best-effort support from the community, including from  who created this asset.
Dependencies
RunJsFunction has no dependencies.
Application Objects
RunJsFunction has 0 AOs.
Team
Compatible with
Version 11
Database:
All
Asset consumers
No consumers yet.
Weekly downloads 
More from Danny Prager