Legacy Dev Forum Posts

 View Only

Sign Up

JSONPath expression doesn't return expected values from response

  • 1.  JSONPath expression doesn't return expected values from response

    Posted 06-05-2025 18:46

    ibrahimsincap | 2024-09-04 20:49:24 UTC | #1

    Hi,

    I'm trying to return some things from response based on my needs but I guess I'm making a mistake somewhere.

    I made the configuration on response configuration but it doesn't work as I expected. I want to return "billingAccountId" from inquireProductDataItemList's items that has productDetailList.familyInfo.familyCategory == "commitment". It will be an array and its name on output contracts is "billingAccountIdList".

    I uploaded output schema, response configuration and a response example. My explanation might not be that good, hopefully uploaded files can help you. I don't know where my mistake is.

    I'm expecting billingAccountIdList like this: [ 830200001294, 830200001095 ]

    But it returns like this: [ 830200001294, 830200001299, 830200001095 ]

    Every other response variables are fine. Problem is this one (even though it seems okay to me); "billingAccountIdList": "$.inquireProductDataItemList[?(@.productDetailList[?(@.familyInfo.familyCategory == 'commitment')])].billingAccountId"

    Any help would be appreciated,

    Regards.

    [response config.json

    attachment](upload://9ykbDLIItogEDwDuCtuhdVT3O0s.json) (2.0 KB)

    [output contract.json

    attachment](upload://5N5dClwZXE7A0x7hr0KUW8OR4K7.json) (1.1 KB)

    [full response.json

    attachment](upload://oh9I9GIkJqHgkRKRQhLYsr9psMw.json) (306.7 KB)


    ibrahimsincap | 2024-09-05 06:55:52 UTC | #2

    Hi,

    After some additional research I changed the filter as this:

    *"billingAccountIdList": "$.inquireProductDataItemList[?(@.productDetailList[].familyInfo.familyCategory CONTAINS 'commitment')].billingAccountId"**

    It works fine right know. This filter might be helpful for people who trouble to retrieve correct values from double nested arrays.


    system | 2024-10-06 06:56:37 UTC | #3

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 28897