Service Virtualization

  • 1.  How to filter attribute values from JSON request

    Posted Nov 23, 2017 01:33 AM

    Hi, 

     

    I have a JSON request as follows and I want to fetch account token value based on type(Savings). Can someone assist?

     

    {
    "response": {"response1": [
    {
    "nickname": "Value",
    "accountToken": "123",
    "type": "savings",
    "category": "value"
    },
    {
    "nickname": "Value",
    "accountToken": "1234",
    "type": "current",
    "category": "value"
    }
    ]},
    "status": {
    "code": "API-200",
    "message": "Success"
    }
    }

     

    Thanks,

    Narasimha



  • 2.  Re: How to filter attribute values from JSON request
    Best Answer

    Broadcom Employee
    Posted Nov 23, 2017 10:37 PM
      |   view attached

    Hi,

     

    Could you please try JSON Path Filter?
    Also I attached the sample test case which used 4 "JSON Path Filter"s and based on your JSON.
    In this test case, I could save the properties like:
    Propety name      Value
    accountToken1     123
    type1                     savings
    accountToken2     1234
    type2                     current
    This test case may help you.

     

    P.S.

    If this reply has correctly answered your question, please click the "Mark Correct" button so others can benefit from this information.

     

    Cheers,

    Attachment(s)

    zip
    test.tst.zip   1 KB 1 version