Functions (Transformation)
  • 31 Mar 2022
  • 1 Minute to read
  • Contributors
  • Dark
    Light

Functions (Transformation)

  • Dark
    Light

The TWIN-Browser JENTIS technology gives you the opportunity to run JavaScript functions on your JENTIS server. Empowering your setup to run functions within the runtime of a virtual TWIN, such as persisting information on localStorage or apply complex logic or processing with the full capability of a programming language. As the backbone for the TWIN is NodeJS.

Functions apply further logic to customize data to your implementations use case. These functions can be referenced in tag configurations. To be applied on certain parameters values.

Function Creation Process

Every function object has the following parameters:

  • Name: This is the value that will appear in the selection in a Tag configuration, here you should use a descriptive name.
  • ID: This is a technical reference that can be used to reference a function explicitly as this ID is unique per JTM account.
  • Description: Feel free to give your Function a description to later better understand the motivation to this application.
  • Code: This is the actual function code that you will define

As a function is referenced in a tag to process and return a value you must define an input and output value. Make sure to use the following basic syntax, as any function must return a value.

async function(input){
  var processed_value = input+1;
  return processed_value;
}

Was this article helpful?