Data Stream (IntegrationHub) Action Output

Shui
Tera Contributor

I am using Data Stream (IntegrationHub) Data Source to import JSON data from a 3rd party site. I would like to use the response body directly as the action output, instead of creating and parsing each child item since there are many child items and some have complex data such as Array.Object. Göran Lundqvist mentioned in this youtube: https://www.youtube.com/watch?v=-lmbcm6j6Ew and I followed his suggestion (@ 55min). In Script Parser Step, I have

(function parse(inputs, outputs) {

   var item = JSON.parse(inputs.sourceItem);
   outputs.targetObject = item;
})(inputs, outputs);
 
However, I do not know how to pass it to the Action Outputs Object. Please help. Thanks!
5 REPLIES 5

Richard Hine
Tera Guru

Shui,

If you haven't already, I recommend you take the

Integration Hub (https://nowlearning.servicenow.com/lxp?id=learning_path_prev&path_id=329ac7201bbafcd4a5e699b1b24bcbe...)

and

Flow Designer Essentials (https://nowlearning.servicenow.com/lxp?id=learning_path_prev&path_id=193b8e6c87acf450ed3b74c9cebb355...)

courses on Now Learning as these will assist you with issues such as this.

The script you have there will create a variable of type object as an output to the action step. If you have the action step output defined then you can simply create an action output variable and drag the data pill for the step output to the action output.

You will need to be aware that both of your variables will be of type object.

Hope this helps,

Richard

Shui
Tera Contributor

Thank you, Richard for your suggestion. Data stream (IntegrationHub) is a little different. I there is no data pill to drag for the action output. 

Here is the Script Parser step.

find_real_file.png

  

 Here is the Outputs step. When I ran text, the Output item is empty. I was able to get the result if I parse and map each child items. 

find_real_file.png

 

 

 

Hi @Shui  ,

 Is the issue Resolved. I am looking for same approach.Need to Pass enitre responsebody to the Output object.

Regards,

VK.

dansieders
Tera Expert

@Shui 

Did you find a solution?

 

I too am using a Data Stream, and parsing the inputs.sourceItem to the outputs.targetObject

(function parse(inputs, outputs) {
    var item = JSON.parse(inputs.sourceItem);
    outputs.targetObject=item; 
})(inputs, outputs);
 
I have created the Action output appropriately;
dansieders_0-1749677704888.png

 

But only the top level values are populated;

dansieders_1-1749677734297.png

 

Any help would be appreciated.

Regards Dan.