Forum Discussion

Prabaharan's avatar
Prabaharan
Contributor
2 years ago

Soap UI rest project - Unable to fetch dynamic response value when multiple nested filters are given

Hi All,

 

I'm trying to pull dynamically generated ID value from my response through Property transfer and trying to substitute in another request. I'm using nested filters in my jsonpath and not the position of the attributes since those are dynamic. Below is my response

{
"TCRMService": {
"@schemaLocation": "http://www.ibm.com/mdm/schema MDMDomains.xsd",
"TxResponse": {
"RequestType": "createCustomer",
"TxResult": {
"ResultCode": "SUCCESS"
},
"ResponseObject": {
"TCRMContractBObj": {
"ContractIdPK": "167368519964531257",
"TCRMContractComponentBObj": {
"ContractComponentIdPK": "162868519964531919",
"TCRMContractPartyRoleBObj": [
{
"ContractRoleIdPK": "161168519964532379",
"RoleValue": "Owner",
"TCRMContractRoleLocationBObj": [
{
"TCRMExtension": {
"ExtendedObject": "XContractRoleLocationBObjExt",
"XContractRoleLocationBObjExt": {
"XCustomerSiteId": "400000009088793"
}
},
"TCRMPartyAddressBObj": [
{
"TCRMAddressBObj": {
"AddressIdPK": "794168518374167884",
"AddressLineOne": "Ap #819-8439 Nonummy Rd.",
"City": "Rothes"
}
}
]
},
{
"TCRMExtension": {
"ExtendedObject": "XContractRoleLocationBObjExt",
"XContractRoleLocationBObjExt": {
"XCustomerSiteId": "400000009088794"
}
},
"TCRMPartyAddressBObj": [
{
"TCRMAddressBObj": {
"AddressIdPK": "796168518374180269",
"AddressLineOne": "3290 LakeView Ave.",
"City": "Miami"
}
}
]
}
]
}
]
}
}
}
}
}
}

 

My jsonpath is : $.TCRMService.TxResponse.ResponseObject.TCRMContractBObj.TCRMContractComponentBObj.TCRMContractPartyRoleBObj[?(@.RoleValue=="Owner")].TCRMContractRoleLocationBObj[?(@.TCRMPartyAddressBObj[?(@.TCRMAddressBObj[?(@.AddressLineOne=="Ap #819-8439 Nonummy Rd.")])])].TCRMExtension.XContractRoleLocationBObjExt.XCustomerSiteId

 

As a result Im expecting [400000009088793] but I'm getting [400000009088793, 400000009088794]. Appreciate if anyone can help me on this. BTW I'm using soapui 5.7.0 version