skip to Main Content

I have input JSON as

{
  "eventTime" : "2024-01-17T15:10:06.858",
  "groupArticleNumber" : "FT6559",
  "groupModelNumber" : "FRX88",
  "productDescriptionEN" : "ESTRO 19 JSYY",
  "subBrand" : "1",
  "brand" : "11",
  "businessSegment" : "104",
  "salesLine" : "L84",
  "materialComposition" : [ "100% PET-REC", "100% PET-DAT" ],
  "mainMaterialFlag" : [ true, false ],
  "productDescEN" : "ESTRO 19 JSYY",
  "colorwayShortDescEN" : "TMLGBL/WHITE",
  "keyCategory" : "00095",
  "ageGroup" : "J",
  "gender" : "M",
  "genderAge" : "16",
  "genderAgeMain" : "Kids",
  "articleLifeCycle" : "50",
  "sizePage" : "J4",
  "articleCreationSeason" : "20201",
  "articleActiveSeason" : "20242",
  "rmhProductDivision" : "2",
  "rmhProductType" : "30",
  "rmhCategory" : "09",
  "retailClass" : "12309",
  "retailSubClass" : "1230930",
  "retailDepartment" : "12",
  "retailSubDepartment" : "123",
  "sourcingSizeCode3" : [ "190", "180" ]
}

and i want output like

[
  {
    "eventTime": "2024-01-17T15:10:06.858",
    "groupArticleNumber": "GI7343",
    "sourcingSizeCode3": "190",
    "productDescEN": "A.RDY UPF LS P",
    "colorwayShortDescEN": "NHLSJS/WHTMEL/BLACK",
    "keyCategory": "00056",
    "groupModelNumber": "FRX88",
    "productDescriptionEN": "ESTRO 19 JSYY",
    "retailClass": "12309",
    "retailSubClass": "1230930",
    "retailDepartment": "12",
    "retailSubDepartment": "123",
    "rmhProductDivision": "2",
    "subBrand": "1",
    "brand": "11",
    "rmhCategory": "09",
    "businessSegment": "104",
    "ageGroup": "J",
    "gender": "M",
    "genderAge": "16",
    "genderAgeMain": "Kids",
    "articleLifeCycle": "50",
    "sizePage": "J4",
    "materialComposition": "100% PET-REC",
    "mainMaterialFlag": true,
    "articleCreationSeason": "20201",
    "articleActiveSeason": "20242",
    "salesLine": "L84",
    "rmhProductType": "30"
  },
  {
    "eventTime": "2024-01-17T15:10:06.858",
    "groupArticleNumber": "GI7343",
    "sourcingSizeCode3": "180",
    "productDescEN": "A.RDY UPF LS P",
    "colorwayShortDescEN": "NHLSJS/WHTMEL/BLACK",
    "keyCategory": "00056",
    "groupModelNumber": "FRX88",
    "productDescriptionEN": "ESTRO 19 JSYY",
    "retailClass": "12309",
    "retailSubClass": "1230930",
    "retailDepartment": "12",
    "retailSubDepartment": "123",
    "rmhProductDivision": "2",
    "subBrand": "1",
    "brand": "11",
    "rmhCategory": "09",
    "businessSegment": "104",
    "ageGroup": "J",
    "gender": "M",
    "genderAge": "16",
    "genderAgeMain": "Kids",
    "articleLifeCycle": "50",
    "sizePage": "J4",
    "materialComposition": "100% PET-REC",
    "mainMaterialFlag": true,
    "articleCreationSeason": "20201",
    "articleActiveSeason": "20242",
    "salesLine": "L84",
    "rmhProductType": "30"
  },
  {
    "eventTime": "2024-01-17T15:10:06.858",
    "groupArticleNumber": "GI7343",
    "sourcingSizeCode3": "190",
    "productDescEN": "A.RDY UPF LS P",
    "colorwayShortDescEN": "NHLSJS/WHTMEL/BLACK",
    "keyCategory": "00056",
    "groupModelNumber": "FRX88",
    "productDescriptionEN": "ESTRO 19 JSYY",
    "retailClass": "12309",
    "retailSubClass": "1230930",
    "retailDepartment": "12",
    "retailSubDepartment": "123",
    "rmhProductDivision": "2",
    "subBrand": "1",
    "brand": "11",
    "rmhCategory": "09",
    "businessSegment": "104",
    "ageGroup": "J",
    "gender": "M",
    "genderAge": "16",
    "genderAgeMain": "Kids",
    "articleLifeCycle": "50",
    "sizePage": "J4",
    "materialComposition": "100% PET-DAT",
    "mainMaterialFlag": false,
    "articleCreationSeason": "20201",
    "articleActiveSeason": "20242",
    "salesLine": "L84",
    "rmhProductType": "30"
  },
  {
    "eventTime": "2024-01-17T15:10:06.858",
    "groupArticleNumber": "GI7343",
    "sourcingSizeCode3": "180",
    "productDescEN": "A.RDY UPF LS P",
    "colorwayShortDescEN": "NHLSJS/WHTMEL/BLACK",
    "keyCategory": "00056",
    "groupModelNumber": "FRX88",
    "productDescriptionEN": "ESTRO 19 JSYY",
    "retailClass": "12309",
    "retailSubClass": "1230930",
    "retailDepartment": "12",
    "retailSubDepartment": "123",
    "rmhProductDivision": "2",
    "subBrand": "1",
    "brand": "11",
    "rmhCategory": "09",
    "businessSegment": "104",
    "ageGroup": "J",
    "gender": "M",
    "genderAge": "16",
    "genderAgeMain": "Kids",
    "articleLifeCycle": "50",
    "sizePage": "J4",
    "materialComposition": "100% PET-DAT",
    "mainMaterialFlag": false,
    "articleCreationSeason": "20201",
    "articleActiveSeason": "20242",
    "salesLine": "L84",
    "rmhProductType": "30"
  }
]

need jolt spec for same

i tried this spec

[
  {
    "operation": "shift",
    "spec": {
      "value": {
        "metadata": {
          "eventTime": "eventTime"
        },
        "payload": {
          "productPrimaryData": {
            "key": {
              "groupArticleNumber": "groupArticleNumber",
              "groupModelNumber": "groupModelNumber"
            },
            "model": {
              "productDescriptionEN": "productDescriptionEN",
              "subBrand": "subBrand",
              "brand": "brand",
              "businessSegment": "businessSegment"
            },
            "modelSeason": {
              "salesLine": "salesLine"
            },
            "articleSeason": {
              "articleMainMaterial": {
                "*": {
                  "materialComposition": "materialComposition",
                  "mainMaterialFlag": "mainMaterialFlag"
                }
              }
            },
            "article": {
              "productDescEN": "productDescEN",
              "colorwayShortDescEN": "colorwayShortDescEN",
              "keyCategory": "keyCategory",
              "ageGroup": "ageGroup",
              "gender": "gender",
              "genderAge": "genderAge",
              "genderAgeMain": "genderAgeMain",
              "articleLifeCycle": "articleLifeCycle",
              "sizePage": "sizePage",
              "articleCreationSeason": "articleCreationSeason",
              "articleActiveSeason": "articleActiveSeason",
              "rmh": {
                "*": {
                  "rmhProductDivision": "rmhProductDivision",
                  "rmhProductType": "rmhProductType",
                  "rmhCategory": "rmhCategory",
                  "retailClass": "retailClass",
                  "retailSubClass": "retailSubClass",
                  "retailDepartment": "retailDepartment",
                  "retailSubDepartment": "retailSubDepartment"
                }
              },
              "articleSize": {
                "*": {
                  "sourcingSizeCode3": "sourcingSizeCode3"
                }
              }
            }
          }
        }
      }
    }
  }
]

but not working

2

Answers


  1. Chosen as BEST ANSWER
    this is my input json `{
       "key":"FRX88_FT6559_20222",
       "value":{
          "metadata":{
             "eventVersion":"SPMXML4_3Out.xsd",
             "eventSource":"GRPSPM",
             "eventName":"ProductPrimary",
             "eventTime":"2024-01-17T15:10:06.858"
          },
          "payload":{
             "header":{
                "sender":"GRPSPM",
                "sequenceNumber":"spm_product_20240117155702_00001",
                "priority":"2",
                "publishingType":"PS",
                "messageType":"Product",
                "targetGroup":"ALL",
                "xsdVersion":"SPMXML4_3Out.xsd"
             },
             "productPrimaryData":{
                "changeFlag":{
                   "articleChange":true,
                   "articleSeasonChange":false,
                   "modelChange":true,
                   "modelSeasonChange":false
                },
                "key":{
                   "groupArticleNumber":"FT6559",
                   "groupModelNumber":"FRX88",
                   "seasonCode":"20222"
                },
                "model":{
                   "altModelNumber":"MS908046",
                   "modelFamily":null,
                   "activity":"High performance football jersey for match day",
                   "inspiration":"Plain & embellishment-friendly design",
                   "uniqueSellingProposition":null,
                   "studs":null,
                   "closure":"00",
                   "consumerFit":"01",
                   "branding":"Flat heat-transferred BoS",
                   "lining":"000",
                   "neckLine":"002",
                   "shoulderStrap":null,
                   "braStyle":null,
                   "fabricWeightPurpose":"51% PES/49% REC.PES; Solid; 123 G/SQM; Hydrophilic (midori); AEROREADY, ClimaLite, Midori adi (hydrophilic finish)",
                   "inseamShortLength":"Standard",
                   "sustainabilityEthics":"007",
                   "originalModelNumber":"FRX88",
                   "licensedVendor":null,
                   "vendorModelNumber":null,
                   "workingModelNumber":"S1906GHTM400Y",
                   "macroModelCode":null,
                   "productDescriptionEN":"ESTRO 19 JSYY",
                   "modelLongDescEN":"Estro 19 Jersey Youth",
                   "consumerFacingProdName":"ESTRO 19 JERSEY",
                   "brandGroup":"10",
                   "brand":"11",
                   "sportsCategory":"06",
                   "productDivision":"2",
                   "productGroup":"28",
                   "productSet":"20",
                   "productType":"16",
                   "ageGroup":"J",
                   "gender":"M",
                   "genderAge":"16",
                   "genderAgeMain":"Kids",
                   "corporateMarketingLine":"98",
                   "categoryMarketingLine":"197",
                   "techConcept":"00341",
                   "techComponent":null,
                   "icgsCode":"25",
                   "subBrand":"1",
                   "businessSegment":"104",
                   "keyCategory":"00095",
                   "devOrganization":"T001",
                   "devLocation":"10",
                   "upperMainMaterial":null,
                   "liningMainMaterial":null,
                   "inSoleMainMaterial":null,
                   "outSoleMainMaterial":null,
                   "quantityUnit":"01",
                   "outPackageQuantity":"60",
                   "toeStackHeightMm":"0",
                   "midSoleOffsetMm":"0",
                   "heelStackHeightMm":"0",
                   "modelCreationSeason":"20191",
                   "modelActiveSeason":"20251",
                   "modelLifecycle":"50",
                   "modelLifecycleStatusDate":{
                      "value":"20190603",
                      "format":"yyyyMMdd"
                   },
                   "modelSourceSystem":"FLXAAG",
                   "arch":null,
                   "braRemovablePadding":null,
                   "shoeType":null,
                   "surface":null,
                   "waistRise":"000",
                   "materialTechnology":"02",
                   "sizePage":"J4",
                   "sourceSizeScale":"T6",
                   "sourcingSampleSizeCode2":"27",
                   "sourcingSampleSizeCode3":"540",
                   "outsoleToolingNumber":null,
                   "upperToolingNumber":null,
                   "midsoleToolingNumber":null,
                   "baseUnit":"PC",
                   "targetMaterialCode":"005",
                   "targetSourceCode":"3",
                   "targetMaterialTechnology":"33",
                   "allocCategoryCode":"0",
                   "productSpeciality":"1",
                   "productDimensionUom":"6",
                   "length":"0",
                   "width":"0",
                   "height":"0",
                   "productDimensionUov":"23",
                   "volume":"0",
                   "weight":"0",
                   "featuresAndBenefits":null,
                   "manufacturingType":null,
                   "manufacturingCapability":"0",
                   "constructionType":"1",
                   "productFit":null,
                   "boxLabelCategory":null,
                   "managementBrand":"11",
                   "materialConceptDesc":null,
                   "franchiseCode":"000",
                   "franchiseInspiredFamily":"000",
                   "franchiseIteration":"000",
                   "intendedUse":"01",
                   "last":null,
                   "modelPocketDetails":null
                },
                "modelSeason":{
                   "salesLine":"L84",
                   "sizeCategory":[
                      "003~009~012"
                   ],
                   "modelProductRelationShip":null,
                   "salesRegion":"04~05~06~07",
                   "devType":"CO",
                   "targetConsumer":"00",
                   "firstExFactoryDate":{
                      "value":"20220315",
                      "format":"yyyyMMdd"
                   },
                   "lastExFactoryDate":{
                      "value":"20221115",
                      "format":"yyyyMMdd"
                   },
                   "specialUsage":null,
                   "sourceSizeList":"480~180~360~560~520~540~230~500~355~200~580~345~340~190~210~220~350",
                   "marketingForecast":"90000",
                   "placeholderStyleCount":1,
                   "productPlaceholder":false,
                   "retailIntroDate":{
                      "value":"20220601",
                      "format":"yyyyMMdd"
                   },
                   "retailExitDate":{
                      "value":"20221130",
                      "format":"yyyyMMdd"
                   },
                   "prodLifecycleSeasonStatus":"50",
                   "designer":"Junyent, Pau",
                   "developer":"Rudolph, Katharina",
                   "loDeveloper":"Nguyen, Yuuna",
                   "productManager":"Frasch, Lukas",
                   "cadPatternMaker":"Nikolic, Natascha",
                   "quarterCode":"34",
                   "timelineCode":"1",
                   "targetFob":2.12,
                   "targetFobCurrency":"USD",
                   "targetRecRetailPrice":15,
                   "targetRecRetailPriceCurrency":"EUR",
                   "secondTargetRecRetailPrice":0,
                   "secondTargetRecRetailPriceCurrency":null,
                   "modelSeasonStatus":"1",
                   "directDev":"2",
                   "logoId":null,
                   "transportationLeadTime":"7",
                   "rangePlanId":null,
                   "rangePlanTitle":null,
                   "dropDate":null,
                   "modelCarriedOverFrom":"20221",
                   "speedRelevant":true
                },
                "articleSeason":{
                   "salesLine":"L84",
                   "targetConsumer":"00",
                   "salesRegion":"04~05~06~07",
                   "developmentType":"CO",
                   "distributionChannel":null,
                   "specialUsage":"00",
                   "productLine":"773",
                   "firstExFactoryDate":{
                      "value":"20220315",
                      "format":"yyyyMMdd"
                   },
                   "lastExFactoryDate":{
                      "value":"20221115",
                      "format":"yyyyMMdd"
                   },
                   "productionLeadTime":45,
                   "retailIntroDate":{
                      "value":"20220601",
                      "format":"yyyyMMdd"
                   },
                   "retailExitDate":{
                      "value":"20221130",
                      "format":"yyyyMMdd"
                   },
                   "prodLifecycleSeasonStatus":"50",
                   "purchaseOrderMinQty":100,
                   "quarterCode":34,
                   "timelineCode":"1",
                   "targetFob":2.12,
                   "targetFobCurrency":"USD",
                   "targetRecRetailPrice":15,
                   "targetRecRetailPriceCurrency":"EUR",
                   "secTargetRecRetailPrice":0,
                   "secTargetRecRetailPriceCurrency":null,
                   "articleMarketingForecast":"0",
                   "articleMainMaterial":[
                      {
                         "materialRefNumber":"70019568",
                         "colorOverwriteInd":true,
                         "materialSupplier":"30",
                         "construction":"Doubleknit",
                         "technology":"02",
                         "fiberTextPosition":"MAIN MATERIAL - 78",
                         "materialComposition":"100% PET-REC",
                         "mainMaterialFlag":true
                      },
                       {
                         "materialRefNumber":"70019568",
                         "colorOverwriteInd":true,
                         "materialSupplier":"30",
                         "construction":"Doubleknit",
                         "technology":"02",
                         "fiberTextPosition":"MAIN MATERIAL - 88",
                         "materialComposition":"100% PET-DAT",
                         "mainMaterialFlag":false
                      }
                   ],
                   "buyReadyDateDeveloper":{
                      "value":"20220117",
                      "format":"yyyyMMdd"
                   },
                   "buyReadySetDate":{
                      "value":"20220113",
                      "format":"yyyyMMdd"
                   },
                   "revisedBuyReadySetDate":null,
                   "articleSeasonStatus":"1",
                   "seasonState":"H",
                   "smuCustomer":null,
                   "colorwayDelayReason":null,
                   "transportationLeadTime":"7",
                   "designer":"Junyent, Pau",
                   "developer":"Rudolph, Katharina",
                   "loDeveloper":"TBA",
                   "productManager":"Frasch, Lukas",
                   "directDev":"2",
                   "seasonalArticleText":null,
                   "colorDesigner":null,
                   "materialWayType":null,
                   "productTestManager":null,
                   "testLevel":null,
                   "dropDate":null,
                   "articleCarriedOverFrom":"20221",
                   "priceBand":"01",
                   "mandatoryRangeCode":"00000",
                   "speedPropositionCode":"00000",
                   "washCareInstructions":null
                },
                "article":{
                   "altArticleNumber":null,
                   "originalArticleNumber":"FT6559",
                   "vendorArticleNumber":null,
                   "baseArticleNumber":null,
                   "articleType":"01",
                   "productDescEN":"ESTRO 19 JSYY",
                   "colorwayName":"team light blue/white",
                   "colorwayShortDescEN":"TMLGBL/WHITE",
                   "colorwayLongDescEN":"TMLGBL/WHITE",
                   "color1":"ADA3",
                   "color2":"001A",
                   "color3":null,
                   "color4":null,
                   "secondaryColorwayDescEN":null,
                   "nrfColorCode":null,
                   "alternateColorCode":null,
                   "graphicCode":null,
                   "graphicDesc":null,
                   "ageGroup":"J",
                   "gender":"M",
                   "genderAge":"16",
                   "genderAgeMain":"Kids",
                   "corporateMarketingLine":"98",
                   "categoryMarketingLine":"197",
                   "techConcept":[
                      "00341"
                   ],
                   "devOrganization":"T001",
                   "devLocation":"10",
                   "subBrand":"1",
                   "businessSegment":"104",
                   "keyCategory":"00095",
                   "pictogramCompositionCode":"XXXXXXXXX",
                   "upperMainMaterial":null,
                   "liningMainMaterial":null,
                   "innerSoleMainMaterial":null,
                   "outerSoleMainMaterial":null,
                   "articleCreationSeason":"20201",
                   "articleActiveSeason":"20242",
                   "articleLifeCycle":"50",
                   "articleLifeCycleStatusDate":{
                      "value":"20190603",
                      "format":"yyyyMMdd"
                   },
                   "articleSourceSystem":"FLXAAG",
                   "sizePage":"J4",
                   "sourcingSizeScale":"T6",
                   "sourcingSampleSizeCode2":"27",
                   "sourcingSampleSizeCode3":"540",
                   "productFit":null,
                   "orderLockedIndicator":false,
                   "materialWayId":"JZF0GELBADXBNO2L",
                   "marketingActivationDueDate":null,
                   "targetRetailExitSeason":"20271",
                   "imageConfidential":"N",
                   "imageLaunchDate":null,
                   "graphicPattern":[
                      "000"
                   ],
                   "articleDescMl":[
                      {
                         "languageCode":"01",
                         "articleDescription":"ESTRO 19 JSYY"
                      },
                      {
                         "languageCode":"02",
                         "articleDescription":"ESTRO 19 JSYY"
                      },
                      {
                         "languageCode":"03",
                         "articleDescription":"ESTRO 19 JSYY"
                      },
                      {
                         "languageCode":"04",
                         "articleDescription":"ESTRO 19 JSYY"
                      },
                      {
                         "languageCode":"05",
                         "articleDescription":"ESTRO 19 JSYY"
                      },
                      {
                         "languageCode":"06",
                         "articleDescription":"ESTRO 19 JSYY"
                      }
                   ],
                   "colorwayDescMl":[
                      {
                         "languageCode":"01",
                         "colorwayShortDesc":"TMLGBL/WHITE",
                         "colorwayLongDesc":"TMLGBL/WHITE"
                      },
                      {
                         "languageCode":"02",
                         "colorwayShortDesc":"TMLGBL/WHITE",
                         "colorwayLongDesc":"TMLGBL/WHITE"
                      },
                      {
                         "languageCode":"03",
                         "colorwayShortDesc":"TMLGBL/BLANC",
                         "colorwayLongDesc":"TMLGBL/BLANC"
                      },
                      {
                         "languageCode":"04",
                         "colorwayShortDesc":"TMLGBL/BLANCO",
                         "colorwayLongDesc":"TMLGBL/BLANCO"
                      },
                      {
                         "languageCode":"05",
                         "colorwayShortDesc":"TMLGBL/BRANCO",
                         "colorwayLongDesc":"TMLGBL/BRANCO"
                      },
                      {
                         "languageCode":"06",
                         "colorwayShortDesc":"TMLGBL/WHITE",
                         "colorwayLongDesc":"TMLGBL/WHITE"
                      }
                   ],
                   "articleLabel":[
                      {
                         "label":"ATACA",
                         "labelCount":1
                      },
                      {
                         "label":"ASSMC",
                         "labelCount":1
                      }
                   ],
                   "articleComposition":[
                      {
                         "animalType":null,
                         "importCountry":"000",
                         "customsCompTextEN":"100% PET-REC",
                         "pictogramCompTextEN":null,
                         "protectedAnimalInd":null
                      }
                   ],
                   "articleCustomsBti":null,
                   "articleBrandPartner":[
                      {
                         "brandPartner":"00000",
                         "brandPartnerPriorityInd":false
                      }
                   ],
                   "articleTagsInformation":[
                      {
                         "tags":"00049"
                      }
                   ],
                   "articleSize":[
                      {
                         "sourcingSizeCode2":"63",
                         "sourcingSizeCode3":"190",
                         "feasibilityIndicator":true
                      },
                      {
                         "sourcingSizeCode2":"62",
                         "sourcingSizeCode3":"180",
                         "feasibilityIndicator":true
                      }
                   ],
                   "rmh":[
                      {
                         "rmhMarketingDivision":"1",
                         "rmhProductDivision":"2",
                         "rmhGender":"3",
                         "rmhCategory":"09",
                         "rmhProductType":"30",
                         "retailDepartment":"12",
                         "retailSubDepartment":"123",
                         "retailClass":"12309",
                         "retailSubClass":"1230930"
                      }
                   ]
                }
             }
          }
       },
       "headers":{
          "X_INSTANA_L_S":"1",
          "X_INSTANA_T":"0000000000000000553d86df527194d5",
          "X_INSTANA_S":"87cb409133490aa9"
       }
    }`
    
    and my expetced output is `[
        {
            "eventTime": "2024-01-17T15:10:06.858",
            "groupArticleNumber": "GI7343",
            "sourcingSizeCode3": "190",
            "productDescEN": "A.RDY UPF LS P",
            "colorwayShortDescEN": "NHLSJS/WHTMEL/BLACK",
            "keyCategory": "00056",
            "groupModelNumber": "FRX88",
            "productDescriptionEN": "ESTRO 19 JSYY",
            "retailClass": "12309",
            "retailSubClass": "1230930",
            "retailDepartment": "12",
            "retailSubDepartment": "123",
            "rmhProductDivision": "2",
            "subBrand": "1",
            "brand": "11",
            "rmhCategory": "09",
            "businessSegment": "104",
            "ageGroup": "J",
            "gender": "M",
            "genderAge": "16",
            "genderAgeMain": "Kids",
            "articleLifeCycle": "50",
            "sizePage": "J4",
            "materialComposition": "100% PET-REC",
            "mainMaterialFlag": true,
            "articleCreationSeason": "20201",
            "articleActiveSeason": "20242",
            "salesLine": "L84",
            "rmhProductType": "30"
        },
        {
            "eventTime": "2024-01-17T15:10:06.858",
            "groupArticleNumber": "GI7343",
            "sourcingSizeCode3": "180",
            "productDescEN": "A.RDY UPF LS P",
            "colorwayShortDescEN": "NHLSJS/WHTMEL/BLACK",
            "keyCategory": "00056",
            "groupModelNumber": "FRX88",
            "productDescriptionEN": "ESTRO 19 JSYY",
            "retailClass": "12309",
            "retailSubClass": "1230930",
            "retailDepartment": "12",
            "retailSubDepartment": "123",
            "rmhProductDivision": "2",
            "subBrand": "1",
            "brand": "11",
            "rmhCategory": "09",
            "businessSegment": "104",
            "ageGroup": "J",
            "gender": "M",
            "genderAge": "16",
            "genderAgeMain": "Kids",
            "articleLifeCycle": "50",
            "sizePage": "J4",
            "materialComposition": "100% PET-REC",
            "mainMaterialFlag": true,
            "articleCreationSeason": "20201",
            "articleActiveSeason": "20242",
            "salesLine": "L84",
            "rmhProductType": "30"
        },
        {
            "eventTime": "2024-01-17T15:10:06.858",
            "groupArticleNumber": "GI7343",
            "sourcingSizeCode3": "190",
            "productDescEN": "A.RDY UPF LS P",
            "colorwayShortDescEN": "NHLSJS/WHTMEL/BLACK",
            "keyCategory": "00056",
            "groupModelNumber": "FRX88",
            "productDescriptionEN": "ESTRO 19 JSYY",
            "retailClass": "12309",
            "retailSubClass": "1230930",
            "retailDepartment": "12",
            "retailSubDepartment": "123",
            "rmhProductDivision": "2",
            "subBrand": "1",
            "brand": "11",
            "rmhCategory": "09",
            "businessSegment": "104",
            "ageGroup": "J",
            "gender": "M",
            "genderAge": "16",
            "genderAgeMain": "Kids",
            "articleLifeCycle": "50",
            "sizePage": "J4",
             "materialComposition":"100% PET-DAT",
            "mainMaterialFlag": false,
            "articleCreationSeason": "20201",
            "articleActiveSeason": "20242",
            "salesLine": "L84",
            "rmhProductType": "30"
        },
        {
            "eventTime": "2024-01-17T15:10:06.858",
            "groupArticleNumber": "GI7343",
            "sourcingSizeCode3": "180",
            "productDescEN": "A.RDY UPF LS P",
            "colorwayShortDescEN": "NHLSJS/WHTMEL/BLACK",
            "keyCategory": "00056",
            "groupModelNumber": "FRX88",
            "productDescriptionEN": "ESTRO 19 JSYY",
            "retailClass": "12309",
            "retailSubClass": "1230930",
            "retailDepartment": "12",
            "retailSubDepartment": "123",
            "rmhProductDivision": "2",
            "subBrand": "1",
            "brand": "11",
            "rmhCategory": "09",
            "businessSegment": "104",
            "ageGroup": "J",
            "gender": "M",
            "genderAge": "16",
            "genderAgeMain": "Kids",
            "articleLifeCycle": "50",
            "sizePage": "J4",
             "materialComposition":"100% PET-DAT",
            "mainMaterialFlag": false,
            "articleCreationSeason": "20201",
            "articleActiveSeason": "20242",
            "salesLine": "L84",
            "rmhProductType": "30"
        }
    ]`
    

    For this i want the jolt spec so tried spec and got the above Json .and then tried your solution it is getting expected output,

    But can you do this in one step??


  2. You can use the following shift transformation specs :

    [
      { // group by two types of arrays and objects
        "operation": "shift",
        "spec": {
          "*": "Others.&",
          "*ateria*": {
            "*": {
              "@": "x[&1].&2"
            }
          },
          "sourcingSizeCode3": {
            "*": {
              "@": "y[&1].&2"
            }
          }
        }
      },
      { // multiplex the arrays "x" vs. "y" through use of @1 representation
        "operation": "shift",
        "spec": {
          "Others": "&",
          "*": {
            "*": {
              "@1": "&2&1"
            }
          }
        }
      },
      {
        "operation": "shift",
        "spec": {
          "Others": "&",
          "x*": {
            "*": {
              "*": "&1_&(2,1).&"
            }
          },
          "y*": {
            "*": {
              "*": "&(2,1)_&1.&" // the reversely tiled with respect to the upper identifiers  
                                 // nested within "x*" object representation
            }
          }
        }
      },
      { // separate "Others" object vs. array
        "operation": "shift",
        "spec": {
          "Others": "&",
          "*": "arr"
        }
      },
      {
        "operation": "shift",
        "spec": {
          "arr": {
            "*": {
              "@2,Others": { "*": "[&1].&" }, // go two levels up the tree to grab the values from the "arr" array
              "*": "[&1].&"
            }
          }
        }
      }
    ]
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search