<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Creating separate list using JOLT in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Creating-separate-list-using-JOLT/m-p/390256#M247236</link>
    <description>&lt;P&gt;For jslt , like I said sometimes its easier to write and work with specially if you are trying to get\aggregate data from heavily nested structure. The other advantage jslt has its ability to traverse nested levels dynamically using recursive function calls for example lets say you are working with json structure but have no idea how many nested level it might have (see my json\jslt answer in the this &lt;A href="https://stackoverflow.com/questions/78123690/find-deepest-level-in-different-jsons/78540954#78540954" target="_self"&gt;post&lt;/A&gt; to get an idea what I mean by that ). On the other hand jolt appears to&amp;nbsp; perform a little bit better in comparison but they are very close.&lt;/P&gt;&lt;P&gt;In regards to your question you use the follow to extract single value for the path name:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  "@(2,values[0])": "paths.[&amp;amp;5].pathName"&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 12 Jul 2024 17:18:19 GMT</pubDate>
    <dc:creator>SAMSAL</dc:creator>
    <dc:date>2024-07-12T17:18:19Z</dc:date>
    <item>
      <title>Creating separate list using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Creating-separate-list-using-JOLT/m-p/390159#M247219</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;is it possible to create seperate individual list from one list based on some conditions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;e.g i have a list that have category &amp;amp; product information so i have to create individual list based on category/item id with excludeInd flag 0/1,&lt;/P&gt;&lt;P&gt;List A - CategoryIds List -&amp;gt; Exclude&amp;nbsp;&lt;/P&gt;&lt;P&gt;List B - CategoryIds List -&amp;gt; Include&amp;nbsp;&lt;/P&gt;&lt;P&gt;List C - ProductIds List -&amp;gt; Exclude&amp;nbsp;&lt;/P&gt;&lt;P&gt;List D -ProductIds List -&amp;gt; Include&amp;nbsp;&lt;/P&gt;&lt;P&gt;Input&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "correlationId": "3242a7b4-7929-43b3-9fb6-0d7e173373af",
  "sourceSystemId": "PCS",
  "messageTimestamp": "2024-05-03T00:00:00",
  "id": 1234,
  "promotionId": 2303,
  "offerId": 2303,
  "description": "Members Get Tees $15",
  "customerDescription": "Members Get Tees $15",
  "levelCode": 0,
  "typeCode": 3,
  "templateId": 4,
  "couponCode": null,
  "isCouponCodeRequired": 0,
  "startDatetime": "2024-06-20T00:00:00",
  "endDatetime": "2024-06-24T23:59:00",
  "cancelationDatetime": null,
  "comments": null,
  "distributionRuleCode": null,
  "exclusiveDiscountInd": 0,
  "tiers": [
    {
      "conditions": [
        {
          "conditionId": 1134,
          "buySpendType": 0,
          "buySpendValue": 1,
          "buyUom": "EA",
          "conditionsMerch": [
            {
              "conditionMerchId": 85339,
              "merchandiseLevel": 5,
              "deptClass": 0,
              "uniqueClass": 0,
              "subClass": 0,
              "uniqueSubClass": 0,
              "item": "613631673",
              "categoryId": "",
              "diffId": "012",
              "excludeInd": 0,
              "cancelDatetime": null,
              "supplierSite": null,
              "brandName": null,
              "class": 0
            },
            {
              "conditionMerchId": 85339,
              "merchandiseLevel": 5,
              "deptClass": 0,
              "uniqueClass": 0,
              "subClass": 0,
              "uniqueSubClass": 0,
              "item": "613631674",
              "categoryId": "",
              "diffId": "012",
              "excludeInd": 0,
              "cancelDatetime": null,
              "supplierSite": null,
              "brandName": null,
              "class": 0
            },
            {
              "conditionMerchId": 85340,
              "merchandiseLevel": 5,
              "deptClass": 0,
              "uniqueClass": 0,
              "subClass": 0,
              "uniqueSubClass": 0,
              "item": "613631673",
              "categoryId": "",
              "diffId": "023",
              "excludeInd": 1,
              "cancelDatetime": null,
              "supplierSite": null,
              "brandName": null,
              "class": 0
            },
            {
              "conditionMerchId": 85341,
              "merchandiseLevel": 5,
              "deptClass": 0,
              "uniqueClass": 0,
              "subClass": 0,
              "uniqueSubClass": 0,
              "item": "",
              "categoryId": "613631673",
              "diffId": "013",
              "excludeInd": 0,
              "cancelDatetime": null,
              "supplierSite": null,
              "brandName": null,
              "class": 0
            }
          ]
        }
      ],
      "rewards": [
        {
          "rewardId": 8127,
          "changeType": 2,
          "changeAmount": 15,
          "changePercent": null,
          "quantityToDiscount": null,
          "applyInd": 2,
          "rewardsMerch": []
        }
      ],
      "priceRuleAttributes": [
        {
          "type": "CFA",
          "id": "PR_BRANCH_NAME",
          "values": [
            "MEMBERS"
          ]
        },
        {
          "type": "CFA",
          "id": "PR_PRICE_RULE_PROMO",
          "valueBoolean": true
        },
        {
          "type": "CFA",
          "id": "PR_TARGET_SEGMENT",
          "values": [
            "PAS_LOGGEDIN",
            "LOGGEDIN",
            "PAS_NOT_LOGGEDIN"
          ]
        }
      ]
    },
    {
      "conditions": [
        {
          "conditionId": 1135,
          "buySpendType": 0,
          "buySpendValue": 1,
          "buyUom": "EA",
          "conditionsMerch": [
            {
              "conditionMerchId": 85342,
              "merchandiseLevel": 5,
              "deptClass": 0,
              "uniqueClass": 0,
              "subClass": 0,
              "uniqueSubClass": 0,
              "item": "",
              "categoryId": "613631673",
              "diffId": "012",
              "excludeInd": 0,
              "cancelDatetime": null,
              "supplierSite": null,
              "brandName": null,
              "class": 0
            },
            {
              "conditionMerchId": 85343,
              "merchandiseLevel": 5,
              "deptClass": 0,
              "uniqueClass": 0,
              "subClass": 0,
              "uniqueSubClass": 0,
              "item": "",
              "categoryId": "613631674",
              "diffId": "023",
              "excludeInd": 1,
              "cancelDatetime": null,
              "supplierSite": null,
              "brandName": null,
              "class": 0
            }
          ]
        }
      ],
      "rewards": [
        {
          "rewardId": 8128,
          "changeType": 2,
          "changeAmount": 18,
          "changePercent": null,
          "quantityToDiscount": null,
          "applyInd": 2,
          "rewardsMerch": []
        }
      ],
      "priceRuleAttributes": [
        {
          "type": "CFA",
          "id": "PR_BRANCH_NAME",
          "values": [
            "NON MEMBERS"
          ]
        },
        {
          "type": "CFA",
          "id": "PR_PRICE_RULE_PROMO",
          "valueBoolean": true
        }
      ]
    }
  ],
  "locations": [
    {
      "location": 10051,
      "cancelDateTime": null,
      "action": "INSERT",
      "locationType": "S"
    }
  ],
  "attributes": {
    "webCategoryInd": false,
    "currencyCode": "USD",
    "priceType": "PROMOTION",
    "createTimestamp": "2024-05-03T00:00:00",
    "createUserId": "BRANDIE_YAWS@ANFCORP.COM",
    "approvalId": "BRANDIE_YAWS@ANFCORP.COM",
    "lastUpdateProgramId": "PCS",
    "lastUpdateTimestamp": "2024-05-03T00:00:00",
    "lastUpdateUserId": "BRANDIE_YAWS@ANFCORP.COM",
    "emergencyInd": false,
    "promoTypeCode": "TP"
  },
  "customAttributes": [
    {
      "type": "CFA",
      "id": "ALLOW_UNIQUE_CD_REPLEN",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "ANF_BRAND",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "ANF_MENS",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "ANF_WOMENS",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "APP",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "APPLYDEALORDER",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "BESTDEAL",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "BOGO",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "CALL_CENTER",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "CATEGORY",
      "values": [
        "1"
      ]
    },
    {
      "type": "CFA",
      "id": "CND_EQ_RWD",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "CND_FLAGS",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "CND_MRCHTYPE_EXCL_FP",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "CND_MRCHTYPE_EXCL_PROMO",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "CND_MRCHTYPE_EXCL_REDLINES",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "CND_TARGET",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "ECOMM_BIZ_PROMO_CAT",
      "values": [
        "Member Pricing"
      ]
    },
    {
      "type": "CFA",
      "id": "EMPLOYEESELIGIBLE",
      "valueBoolean": true
    },
    {
      "type": "CFA",
      "id": "EXTERNALNAME",
      "values": [
        "Members Get Tees $15"
      ]
    },
    {
      "type": "CFA",
      "id": "FLOOR",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "GH_BRAND",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "GH_FEMALE",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "GH_MALE",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "HCO_BRAND",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "HCO_GIRLS",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "HCO_GUYS",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "HOME_OFFICE_ASSOC_PROMO",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "KIDS_BOYS",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "KIDS_BRAND",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "KIDS_GIRLS",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "LOGGEDON",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "PHYSICAL_STORE",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "PR_BRANCH_NAME",
      "values": [
        "MEMBERS"
      ]
    },
    {
      "type": "CFA",
      "id": "PR_PRICE_RULE_PROMO",
      "valueBoolean": true
    },
    {
      "type": "CFA",
      "id": "PR_TARGET_SEGMENT",
      "values": [
        "1"
      ]
    },
    {
      "type": "CFA",
      "id": "REDEMPTION_CHANNELS",
      "values": [
        "2"
      ]
    },
    {
      "type": "CFA",
      "id": "RWD_FLAGS",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "RWD_MRCHTYPE_EXCL_FP",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "RWD_MRCHTYPE_EXCL_PROMO",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "RWD_MRCHTYPE_EXCL_REDLINES",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "RWD_TARGET",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "SHIPPING_PROMO",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "STORES_BIZ_PROMO_CAT",
      "values": [
        "NA"
      ]
    },
    {
      "type": "CFA",
      "id": "UPTO",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "WEBCAT_PROMO",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "WEB_DESKTOP",
      "valueBoolean": false
    },
    {
      "type": "CFA",
      "id": "WEB_MOBILE",
      "valueBoolean": false
    }
  ]
}&lt;/LI-CODE&gt;&lt;P&gt;Spec&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "operation": "shift",
    "spec": {
      "description": "priceRuleName",
      "startDatetime": "startDate",
      "endDatetime": "enddate",
      "locations": {
        "0": {
          "location": "storeLocation"
        }
      },
      "customAttributes": {
        "*": {
          "id": {
            "PR_PRICE_RULE_PROMO": {
              "@(2,valueBoolean)": "priceRulePromo"
            }
          }
        }
      },
      "tiers": {
        "*": {
          "priceRuleAttributes": {
            "*": {
              "id": {
                "PR_BRANCH_NAME": {
                  "@(2,values)": "paths.[&amp;amp;5].pathName"
                },
                "PR_TARGET_SEGMENT": {
                  "@(2,values)": "paths.[&amp;amp;5].customerCondition[].targetSegments"
                }
              }
            }
          },
          "rewards": "paths[&amp;amp;1].calculatePrice",
          "conditions": "paths[&amp;amp;1].conditions"
        }
      }
    }
  }
]&lt;/LI-CODE&gt;&lt;P&gt;Expected Output&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "priceRuleName" : "Members Get Tees $15",
  "startDate" : "2024-06-20T00:00:00",
  "enddate" : "2024-06-24T23:59:00",
  "storeLocation" : 10051,
  "priceRulePromo" : true,
  "paths" : [ {
    "pathName" : [ "MEMBERS" ],
    "customerCondition" : [ {
      "targetSegments" : [ "PAS_LOGGEDIN", "LOGGEDIN", "PAS_NOT_LOGGEDIN" ]
    } ],
    "calculatePrice" : [ {
      "rewardId" : 8127,
      "changeType" : 2,
      "changeAmount" : 15,
      "changePercent" : null,
      "quantityToDiscount" : null,
      "applyInd" : 2,
      "rewardsMerch" : [ ]
    } ],
    "catalogCondition": {
          "category": [
            {
              "include": "no",
              "categoryList": [
                "613631673"
              ]
            }
          ],
          "products": [
            {
              "include": "no",
              "productList": [
                "613631673",
                "613631674"
              ]
            },
            {
              "include": "yes",
              "productList": [
                "613631673"
              ]
            }
          ]
        }
    
  }, {
    "pathName" : [ "NON MEMBERS" ],
    "calculatePrice" : [ {
      "rewardId" : 8128,
      "changeType" : 2,
      "changeAmount" : 18,
      "changePercent" : null,
      "quantityToDiscount" : null,
      "applyInd" : 2,
      "rewardsMerch" : [ ]
    } ],
    "catalogCondition": {
          "category": [
            {
              "include": "no",
              "categoryList": [
                "613631673",
                "613631674"
              ]
            }
          ]
        }
  } ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2024 15:57:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Creating-separate-list-using-JOLT/m-p/390159#M247219</guid>
      <dc:creator>Syed0000</dc:creator>
      <dc:date>2024-07-11T15:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: Creating separate list using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Creating-separate-list-using-JOLT/m-p/390161#M247220</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/111538"&gt;@Syed0000&lt;/a&gt;&amp;nbsp;Welcome to the Cloudera Community!&lt;BR /&gt;&lt;BR /&gt;To help you get the best possible solution, I have tagged our NiFi experts&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/80381"&gt;@SAMSAL&lt;/a&gt;&amp;nbsp; who may be able to assist you further.&lt;BR /&gt;&lt;BR /&gt;Please keep us updated on your post, and we hope you find a satisfactory solution to your query.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2024 16:05:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Creating-separate-list-using-JOLT/m-p/390161#M247220</guid>
      <dc:creator>DianaTorres</dc:creator>
      <dc:date>2024-07-11T16:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: Creating separate list using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Creating-separate-list-using-JOLT/m-p/390164#M247223</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/111538"&gt;@Syed0000&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;There is a lot going on in the json input and expected output that is hard to follow what you are trying to do . Can you shorten\simplify your json input by removing un necessary or or repeated info. It would be even better to come up with dummy json that focuses on the issue. That would help me in providing accurate resolution.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2024 17:47:48 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Creating-separate-list-using-JOLT/m-p/390164#M247223</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2024-07-11T17:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: Creating separate list using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Creating-separate-list-using-JOLT/m-p/390174#M247224</link>
      <description>&lt;P&gt;Here is simplified input and output json.&lt;BR /&gt;&lt;BR /&gt;Input&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "tiers": [
    {
      "conditions": [
        {
          "conditionsMerch": [
            {
              "item": "613631673",
              "categoryId": "",
              "excludeInd": 0
            },
            {
              "item": "613631674",
              "categoryId": "",
              "excludeInd": 0
            },
            {
              "item": "613631675",
              "categoryId": "",
              "excludeInd": 1
            },
            {
              "item": "",
              "categoryId": "123455",
              "excludeInd": 0
           }
          ]
        }
      ]
    },
    {
      "conditions": [
        {
          "conditionsMerch": [
            {
              "item": "",
              "categoryId": "613631673",
              "excludeInd": 0
            },
            {
              "item": "",
              "categoryId": "613631674",
              "excludeInd": 1
            },
            {
              "item": "",
              "categoryId": "613631675",
              "excludeInd": 1
            }
          ]
        }
      ]
    }
  ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Output&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "pricePaths": {
    "paths": [
      {
        "catalogCondition": {
          "category": [
            {
              "include": "no",
              "categoryList": [
                "123455"
               ]
            }
          ],
          "products": [
            {
              "include": "no",
              "productList": [
                "613631673",
                "613631674"
              ]
            },
            {
              "include": "yes",
              "productList": [
                "613631675",
              ]
            }
          ]
        }
      },
      {
        
        "catalogCondition": {
          "category": [
            {
              "include": "no",
              "categoryList": [
                "613631673"
                
              ]
            },
            {
              "include": "yes",
              "categoryList": [
                "613631674",
                "613631675"
              ]
            }
          ]
      }
    ]
  }
}&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 11 Jul 2024 19:42:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Creating-separate-list-using-JOLT/m-p/390174#M247224</guid>
      <dc:creator>Syed0000</dc:creator>
      <dc:date>2024-07-11T19:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: Creating separate list using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Creating-separate-list-using-JOLT/m-p/390216#M247229</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Actually I went against the main&amp;nbsp; input since the second input (simplified version) is not valid json. Hopefully the following will work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "operation": "shift",
    "spec": {
      "description": "priceRuleName",
      "startDatetime": "startDate",
      "endDatetime": "enddate",
      "locations": {
        "0": {
          "location": "storeLocation"
        }
      },
      "customAttributes": {
        "*": {
          "id": {
            "PR_PRICE_RULE_PROMO": {
              "@(2,valueBoolean)": "priceRulePromo"
            }
          }
        }
      },
      "tiers": {
        "*": {
          "priceRuleAttributes": {
            "*": {
              "id": {
                "PR_BRANCH_NAME": {
                  "@(2,values)": "paths.[&amp;amp;5].pathName"
                },
                "PR_TARGET_SEGMENT": {
                  "@(2,values)": "paths.[&amp;amp;5].customerCondition[#2].targetSegments"
                }
              }
            }
          },
          "rewards": "paths[&amp;amp;1].calculatePrice",
          "conditions": {
            "*": {
              "conditionsMerch": {
                "*": {
                  "item": {
                    "": {
                      "@(2,excludeInd)": {
                        //group categories under yes\no include ind 
                        "0": {
                          "@(4,categoryId)": "paths[&amp;amp;9].catalogCondition.category.yes.categoryList[]"
                        },
                        "1": {
                          "@(4,categoryId)": "paths[&amp;amp;9].catalogCondition.category.no.categoryList[]"
                        }
                      }
                    }, //there is a valye in item -&amp;gt; products
                    "*": {
                      "@(2,excludeInd)": {
                        //group products under yes\no include ind 
                        "0": {
                          "@(4,item)": "paths[&amp;amp;9].catalogCondition.products.yes.productList[]"
                        },
                        "1": {
                          "@(4,item)": "paths[&amp;amp;9].catalogCondition.products.no.productList[]"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  ,
  {
    "operation": "shift",
    "spec": {
      "*": "&amp;amp;",
      "paths": {
        "*": {
          "*": "&amp;amp;2[&amp;amp;1].&amp;amp;",
          "catalogCondition": {
            "*": { //products or category
              "*": { //bucket each yes\no group into its own array element
                "*": "&amp;amp;5[&amp;amp;4].&amp;amp;3.&amp;amp;2[#2].&amp;amp;",
                "$": "&amp;amp;5[&amp;amp;4].&amp;amp;3.&amp;amp;2[#2].include"
              }
            }
          }
        }
      }
    }
  }
  /**/
]&lt;/LI-CODE&gt;&lt;P&gt;Also something to consider is using JSLT. JSTL is another json transformation language similar to xquery in syntax ( check reference &lt;A href="https://github.com/schibsted/jslt/tree/master" target="_self"&gt;here&lt;/A&gt;) . There is jslt processor in nifi for that. In my openion jslt works better in these situation specially when you trying to query data from very nested structure using some complex logic to match on certain values . You probably have to write less lines in jslt and the logic is easier to follow than jolt (of course if you have get familiar with jslt syntax and how it works first to make sense of it)&lt;/P&gt;&lt;P&gt;Here is how this transformation looks using jslt:&lt;/P&gt;&lt;LI-CODE lang="ruby"&gt;import "http://jslt.schibsted.com/2018/experimental" as exp 

let priceRulePromoArray = [for (.customAttributes) .valueBoolean if(.id=="PR_PRICE_RULE_PROMO")]

let mainInfo = {
                  
                
                  "priceRuleName":.description,
                  "startDate":.startDatetime,
                  "enddate":.endDatetime,
                  "storeLocation":.locations[0].location,
                  
                  "priceRulePromo":$priceRulePromoArray[0]

               }

let paths= [for(.tiers)
                        
            {  
                           
             "pathname":flatten([for(.priceRuleAttributes) .values
                                  if(.id=="PR_BRANCH_NAME")]),
             "customerCondition":[for(.priceRuleAttributes).values
                                  if(.id=="PR_TARGET_SEGMENT")],
             "calculatePrice": .rewards,
             "catalogCondition":[for(.conditions) 
                                   let groupProductByInd = 
                                       exp:group-by([for (.conditionsMerch) . if(.item!="")]
                                                     ,.excludeInd,
                                                     .item)
                                  let groupCategoryByInd = 
                                      exp:group-by([for (.conditionsMerch) . if(.categoryId!="")]
                                                   ,.excludeInd
                                                   , .categoryId)

                               let products = [for ($groupProductByInd )
                                                  { 
                                                   "include": if(.key==0) "yes" else "no",
                                                   "productList":.values
                                                  } 
                                              ] 
                               let category = [for ($groupCategoryByInd )
                                                  { 
                                                    "include": if(.key==0) "yes" else "no", 
                                                    "categoryList":.values
                                                  }
                                               ] 
                                                    
                                if(any($products))  {"products":$products} else {} +                                                   
                                if(any($category )) {"category":$category} else {} 
                                                  
                              ]
             }
         ]


{"paths":$paths}+$mainInfo&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 14:07:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Creating-separate-list-using-JOLT/m-p/390216#M247229</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2024-07-12T14:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: Creating separate list using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Creating-separate-list-using-JOLT/m-p/390255#M247235</link>
      <description>&lt;P&gt;Thanks really appreciated, is it good to use JSLT at java level , any cons as compare to JOLT.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also how can i get single value for&amp;nbsp;pathName instead of List.&lt;/P&gt;&lt;P&gt;"pathName" : [ "MEMBERS" ] -- &amp;gt;.&amp;nbsp;"pathName" : "MEMBERS"&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 16:49:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Creating-separate-list-using-JOLT/m-p/390255#M247235</guid>
      <dc:creator>Syed0000</dc:creator>
      <dc:date>2024-07-12T16:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: Creating separate list using JOLT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Creating-separate-list-using-JOLT/m-p/390256#M247236</link>
      <description>&lt;P&gt;For jslt , like I said sometimes its easier to write and work with specially if you are trying to get\aggregate data from heavily nested structure. The other advantage jslt has its ability to traverse nested levels dynamically using recursive function calls for example lets say you are working with json structure but have no idea how many nested level it might have (see my json\jslt answer in the this &lt;A href="https://stackoverflow.com/questions/78123690/find-deepest-level-in-different-jsons/78540954#78540954" target="_self"&gt;post&lt;/A&gt; to get an idea what I mean by that ). On the other hand jolt appears to&amp;nbsp; perform a little bit better in comparison but they are very close.&lt;/P&gt;&lt;P&gt;In regards to your question you use the follow to extract single value for the path name:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  "@(2,values[0])": "paths.[&amp;amp;5].pathName"&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 12 Jul 2024 17:18:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Creating-separate-list-using-JOLT/m-p/390256#M247236</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2024-07-12T17:18:19Z</dc:date>
    </item>
  </channel>
</rss>

