The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Returning Array of objects from response body via Integration HUB

IronPotato
Mega Sage

Hi All,

 

I'm calling REST API via integrationHUB and when I'm parsing the body I'm unable to get proper output. Which should be var results = [{}], so array of objects.

 

Script

IronPotato_0-1697123511429.png

 

Here are my output variables (can anyone explain what is the Results_child variable that is created automaticaly?)

IronPotato_2-1697123657891.png

 

Everything works fine and I'm getting the data until I try to put it into object. So as soon as I wrap the data in curly bracers inside push method, the result array is empty object.

 

{
    "Results": [
        "Zengeon",
        0,
        0,
        "2019-01-18",
        "Vitamin Connection",
        0,
        0,
        "2020-02-20",
        "WARRIOR SPIRIT",
        0,
        0,
        "2021-01-01",
        "Half-Life: Absolute Zero",
        0,
        0,
        "2017-04-17"
    ]
}

 

Any help would be appreciated.

 

Thank you

Tomas

 

1 ACCEPTED SOLUTION

@IronPotato Please refer to this page https://docs.servicenow.com/bundle/sandiego-application-development/page/administer/flow-designer/ta...

 

where starting from point #18 the entire step to create a complex object which is ultimately assigned to an array has been mentioned. 

 

Hope this helps.

View solution in original post

11 REPLIES 11

@Sandeep Rajput ,

 

yes it seems so. Unfortunately it seems that if you want create this type of action (data stream) you have to have paid plugin com.glide.hub.action_type.datastream. Which I'm unable to find in my instance.

 

Thank You.

Yep, an additional plugin might be needed.