To increase flexibility when processing input data, you can retrieve the value directly from the input field by using the JavaScript variable “Input”. If your scenario requires multiple values to be passed, our service allows you to create a JSON object in the input field. This method provides a structured and efficient way to process complex data.
{ "json": { "firstName": "John Doe" } }
return input.json.firstName;
{ output: "John Doe" }
You have to make sure that your input is a valid JSON String and not an object as you write it in JavaScript for example.
If you store the JavaScript function in our CustomJS platform and then execute it using the “Execute a stored function” module with a parameter of an array or a json object, then you have to convert the input once as in the example with JSON.parse().
return JSON.parse(input.users)[0].name;
If you're passing a Make collection as input, use the Transform to JSON module to convert it before using it in your JS code. It is also explained again in this YouTube Video.