cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Matching of JSON object and Array List and filtering output of matched values

ishita_gupta
New Contributor

Hi,

I have an Array List telling me the fields in which changes have occurred.

In the eg. below,
I want the fields in changes to be matched with fields in temp and provide output such that only the matched fields appear in output.

Input:

[
  {
    "temp": [
      {
        "displayGSID": "2519",
        "legalCompanyName": "12 FEB",
        "website": "abc@zyx.com",
        "taxidAndWxformRequired": "NO",
        "taxidFormat": "Othr",
        "companyTypeFix": "SUPPLIER",
        "fields": {
          "field": [
            {
              "id": "EMAILID",
              "value": "demo.Kumar@zyx.com"
            },
            {
              "id": "TRANSACTION_CURRENCY",
              "value": "INR"
            },
            {
              "id": "VENDOR_TYPE",
              "value": "4"
            }
          ]
        }
      }
    ],
    "changes": [
      "website",
      "taxid",
      "fields/field/id=MAILID"
    ]
  }
]

Desired Output:
{
โ€œcompanyDetailsโ€:
{
โ€œwebsiteโ€: โ€œabc@zyx.comโ€,
โ€œtaxidโ€: โ€œโ€,
โ€œfieldsโ€: {
โ€œfieldโ€: [
{
โ€œidโ€: โ€œEMAILIDโ€,
โ€œvalueโ€: โ€œdemo.Kumar@zyx.comโ€
}
]
}
}

0 REPLIES 0