Defining Array Outputs from Connectors (Release 9.2.5.2)

The external service can return data either as simple variables, such as strings or numbers, or as an array such as a list of customer names, account numbers, and addresses. This feature enables you to map those returned arrays to orchestration variables, which can then be acted upon and iterated over by subsequent orchestration steps.

As of Tools Release 9.2.5.2, you can enable the Array option in the Body section of Response to indicate that the data returned is an array and you can define the output sets you want in the array.

Enter the name in the Variable Name field for the array and specify the objects you want to be returned in the array. Enter a value in the Named Object column if you want to pass the entire array as an object to a connector or an orchestration. You can then pass this object for jde__object in the Input column in the Transformations window, instead of iterating over the array directly. This step enables the called orchestration to define how and when the iteration happens.

As shown in the following example, you can define the name and the category as objects in the array by entering these values in the Variable Name column:

This image is described in following text.

When you run this example, you can see the name and category objects defined for the array in the output.

{
    "array": [
        {
            "name": "Pet1",
            "category": {
                "id": 219,
                "name": "Category 1"
            }
        },
        {
            "name": "Pet2",
            "category": {
                "id": 190,
                "name": "Category 2"
            }
        },
        {
            "name": "Pet3",
            "category": {
                "id": 898,
                "name": "Category 3"
            }
        }
    ]
}

You can also define the array shown in the preceding example using the dot notation within the array objects as shown in the following screenshot:

This image is described in following text.

You will get the following output when you use the dot notation. When you use the dot notation, the system pulls the values from inside the object (category) up to the top level of each array element (not inside their own objects).

{
    "array": [
        {
            "name": "Pet1",
            "category.id": 219
        },
        {
            "name": "Pet2",
            "category.id": 190
        },
        {
            "name": "Pet3",
            "category.id": 898
        }
    ]
}

Similarly, in the body of the Response section you can define multiple number of arrays and the output sets you want in each array.