Custom Action - Flow designer

rohith1411
Tera Contributor

I am working in FD where I created a custom action with REST Step and JSON Parser step. This custom action is supposed to be generic so that I want to use it in various flows and the Sample Payload data in JSON Parser step must be dynamic and be pulled in from the Main flow. I can't find no such feature to do that, so I thought of using Script step but again I don't know how to make output variables dynamic as I want the data to be passed as an object to the main flow where I can access each Key/Value pairs directly from the Data pill.

1 REPLY 1

rohith1411
Tera Contributor

In this snippet, 

javascript
(function execute(inputs, outputs) {
var parser = new global.JSONParser();
var parsed = parser.parse(inputs.restResponse.body);
for (var key in parsed) {
outputs[key] = parsed[key];
}
})(inputs, outputs);

What type must be the outputs so that it can be captured and sent to the final output variables?