Hi Lars,
You can use the “map” to map your array of data to the output in this.execute block.
Syntax goes likes this - ArrayofDataNeededAsOutput.map(obj => {
let rObj
rObj= obj
return rObj
});
Sample snippet for reference below
Basically the below code is just mapping the values from input array to output array in this.execute section.
var request = require ("request");
module.exports = function(){
this.input = {
"title": "Sample input",
"type": "object",
"properties": {
userArray: {
type: "array",
title: "Array",
minItems: 1,
items: {
type: "object",
title: "Index",
properties: {
name1: {
type: "string",
title: "Item1",
minimum: 1,
description: "Enter the item"
},
name2: {
type: "string",
title: "Item2",
minimum: 1,
description: "Enter the item"
},
}
},
},
}
};
this.output = {
"title" : "output",
"type" : "object",
"properties":{
"status":{
"title":"status",
"type" :"string"
}
}
};
this.execute = function(input,output){
const map1 = input.userArray.map(obj => {
let rObj
rObj= obj
return rObj
});
return output(null,map1);
}
}
#webMethods#webMethods-io-Integration