DataPower

DataPower

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Json Array Traversing field .

  • 1.  Json Array Traversing field .

    Posted Thu September 03, 2020 09:58 AM

    Hi Hermann ,

    I need traverse below json array responce .

    I have tried below code but does work .

    apim.readInputAsJSON(function(error, buffer) {

    var Description = buffer["RelationShip"][0].Description;

    console.error(Description );

    session.output.write(buffer);

    apim.output('application/json');

    });

    ============

    Responce :-

    [

    {

    "RelationShip": [

    {

    "ID": 1,

    "RelationshipID": 1,

    "Description": "Spouse"

    },

    {

    "ID": 2,

    "RelationshipID": 2,

    "Description": "Child"

    },

    {

    "ID": 3,

    "RelationshipID": 3,

    "Description": "Parent"

    }

    ]

    }

    ]



    #DataPower
    #Support
    #SupportMigration


  • 2.  RE: Json Array Traversing field .

    Posted Tue September 08, 2020 05:32 AM

    Hi,

    Can you please provide a bit more details what you are trying to achieve? Are you trying to print out all the descriptions or?

    -Hermanni



    #DataPower
    #Support
    #SupportMigration