Question
JOLT Nested Array
Hi,
Could be please help me why categoryList is combining all values inside one list instead of 2nd index of paths object , like productList is working fine only difference is that i added one more condition for categoryList that is causing the issue. could you please suggest what i am missing here ?
Input
{
"correlationId": "4c7f8c69-36eb-4f65-bded-6ed08503631a",
"sourceSystemId": "PCS",
"messageTimestamp": "2024-10-29T13:10:54.297-04:00",
"id": 2173,
"promotionId": 569,
"offerId": 2173,
"description": "Price Rule wIncl and Excl - HCO UK",
"levelCode": 0,
"typeCode": 0,
"templateId": 4,
"isCouponCodeRequired": 0,
"startDateTime": "2024-10-30T00:00:00.000Z",
"endDateTime": "2024-10-31T23:59:00.000Z",
"exclusiveDiscountInd": 0,
"tiers": [
{
"conditions": [
{
"conditionId": 374,
"buySpendType": 0,
"buySpendValue": 1,
"buyUom": "EA",
"conditionsMerch": [
{
"merchandiseLevel": 5,
"dept": 0,
"deptClass": 0,
"uniqueClass": 0,
"subClass": 0,
"uniqueSubClass": 0,
"item": "101700348",
"excludeInd": 0,
"keyItemNum": "KIC_123444",
"conditionMerchId": 3110
},
{
"merchandiseLevel": 5,
"dept": 0,
"deptClass": 0,
"uniqueClass": 0,
"subClass": 0,
"uniqueSubClass": 0,
"item": "101700348",
"excludeInd": 1,
"keyItemNum": "KIC_1111111",
"conditionMerchId": 3110
},
{
"merchandiseLevel": 6,
"dept": 0,
"deptClass": 0,
"uniqueClass": 0,
"subClass": 0,
"uniqueSubClass": 0,
"item": "101700348",
"excludeInd": 0,
"webCategoryId": "WEBCTGY_85265",
"conditionMerchId": 3110
},
{
"merchandiseLevel": 6,
"dept": 0,
"deptClass": 0,
"uniqueClass": 0,
"subClass": 0,
"uniqueSubClass": 0,
"item": "101700364",
"excludeInd": 1,
"webCategoryId": "WEBCTGY_166330",
"conditionMerchId": 3111
}
]
}
],
"rewards": [
{
"rewardId": 2293,
"changeType": 2,
"changeAmount": 30,
"changePercent": 0,
"quantityToDiscount": 99,
"applyInd": 2,
"rewardsMerch": []
}
],
"priceRuleAttributes": [
{
"id": "PR_EMPTY_PATH_NAME",
"type": "CFA",
"values": [
"No Everbody Pricing"
]
},
{
"id": "PR_PATH_NAME",
"type": "CFA",
"values": [
"Members Save on HCO AE"
]
},
{
"id": "PR_TARGET_SEGMENT",
"type": "CFA",
"values": [
"LOGIN"
]
}
]
},
{
"conditions": [
{
"conditionId": 371,
"buySpendType": 0,
"buySpendValue": 1,
"buyUom": "EA",
"conditionsMerch": [
{
"merchandiseLevel": 5,
"dept": 0,
"deptClass": 0,
"uniqueClass": 0,
"subClass": 0,
"uniqueSubClass": 0,
"item": "101700348",
"excludeInd": 1,
"keyItemNum": "KIC_1111111",
"conditionMerchId": 3110
},
{
"merchandiseLevel": 5,
"dept": 0,
"deptClass": 0,
"uniqueClass": 0,
"subClass": 0,
"uniqueSubClass": 0,
"item": "101700348",
"excludeInd": 0,
"keyItemNum": "KIC_123444",
"conditionMerchId": 3110
},
{
"merchandiseLevel": 6,
"dept": 0,
"deptClass": 0,
"uniqueClass": 0,
"subClass": 0,
"uniqueSubClass": 0,
"item": "101700348",
"excludeInd": 1,
"webCategoryId": "WEBCTGY_85265",
"conditionMerchId": 3110
},
{
"merchandiseLevel": 6,
"dept": 0,
"deptClass": 0,
"uniqueClass": 0,
"subClass": 0,
"uniqueSubClass": 0,
"item": "101700364",
"excludeInd": 0,
"webCategoryId": "WEBCTGY_166330",
"conditionMerchId": 3105
}
]
}
],
"rewards": [
{
"rewardId": 2290,
"changeType": 2,
"changeAmount": 20,
"changePercent": 0,
"quantityToDiscount": 99,
"applyInd": 2,
"rewardsMerch": []
}
],
"priceRuleAttributes": [
{
"id": "PR_PATH_NAME",
"type": "CFA",
"values": [
"Members Save on Bottoms"
]
},
{
"id": "PR_TARGET_SEGMENT",
"type": "CFA",
"values": [
"LOGIN"
]
}
]
}
],
"locations": [
{
"location": 31082,
"action": "INSERT",
"locationType": "S"
}
],
"customAttributes": [
{
"id": "CND_EQ_RWD",
"type": "CFA",
"valueBoolean": false
},
{
"id": "PR_PRICE_RULE_PROMO",
"type": "CFA",
"valueBoolean": true
},
{
"id": "HOME_OFFICE_ASSOC_PROMO",
"type": "CFA",
"valueBoolean": false
},
{
"id": "WEBCAT_PROMO",
"type": "CFA",
"valueBoolean": true
},
{
"id": "REDEMPTION_CHANNELS",
"type": "CFA",
"values": [
"DTC"
]
},
{
"id": "WEB_DESKTOP",
"type": "CFA",
"valueBoolean": false
},
{
"id": "APPLYAUTOMATICALLY",
"type": "CFA",
"values": [
"AUTO"
]
},
{
"id": "HCO_BRAND",
"type": "CFA",
"valueBoolean": true
},
{
"id": "KIDS_BRAND",
"type": "CFA",
"valueBoolean": false
},
{
"id": "DTC_BIZ_PROMO_CAT",
"type": "CFA",
"values": [
"Members Save on Bottoms"
]
},
{
"id": "EMPLOYEESELIGIBLE",
"type": "CFA",
"valueBoolean": false
},
{
"id": "LOGGEDON",
"type": "CFA",
"valueBoolean": false
},
{
"id": "WEB_MOBILE",
"type": "CFA",
"valueBoolean": false
},
{
"id": "DTC_BIZ_PROMO_CAT",
"type": "CFA",
"values": [
"Member Pricing-HCO UK"
]
},
{
"id": "ALL_CHANNELS",
"type": "CFA",
"valueBoolean": true
},
{
"id": "APP",
"type": "CFA",
"valueBoolean": false
},
{
"id": "EXTERNALNAME",
"type": "CFA",
"values": [
"Members Save on Bottoms - HCO UK"
]
},
{
"id": "ANF_BRAND",
"type": "CFA",
"valueBoolean": false
},
{
"id": "GH_BRAND",
"type": "CFA",
"valueBoolean": false
},
{
"id": "PHYSICAL_STORE",
"type": "CFA",
"valueBoolean": false
},
{
"id": "ALLOW_UNIQUE_CD_REPLEN",
"type": "CFA",
"valueBoolean": false
},
{
"id": "EXTERNALNAME",
"type": "CFA",
"values": [
"Member Pricing-HCO UK"
]
},
{
"id": "CATEGORY",
"type": "CFA",
"values": [
"ECOM"
]
},
{
"id": "STORES_BIZ_PROMO_CAT",
"type": "CFA",
"values": [
"NA"
]
},
{
"id": "CALL_CENTER",
"type": "CFA",
"valueBoolean": false
}
],
"attributes": {
"priceType": "PROMOTION",
"createTimestamp": "2024-10-29T13:02:34.000-04:00",
"createUserId": "REST_USER",
"approvalId": "REST_USER",
"lastUpdateProgramId": "PCS",
"lastUpdateTimestamp": "2024-10-29T13:07:35.000-04:00",
"lastUpdateUserId": "REST_USER",
"emergencyInd": false,
"promoTypeCode": "TP"
}
}
Spec
[
{
"operation": "modify-overwrite-beta",
"spec": {
"tiers": {
"*": {
"conditions": {
"*": {
"conditionsMerch": {
"*": {
"webCategoryId": ["=toString", "notfound"]
}
}
}
}
}
}
}
},
{
"operation": "shift",
"spec": {
"description": "priceRuleName",
"startDateTime": "startDate",
"endDateTime": "enddate",
"locations": {
"0": {
"location": "storeLocation"
}
},
"customAttributes": {
"*": {
"id": {
"PR_PRICE_RULE_PROMO": {
"@(2,valueBoolean)": "priceRulePromo"
},
"ANF_BRAND": {
"@(2,valueBoolean)": {
"true": {
"#ANF": "brand"
}
}
},
"KIDS_BRAND": {
"@(2,valueBoolean)": {
"true": {
"#KIDS": "brand"
}
}
},
"HCO_BRAND": {
"@(2,valueBoolean)": {
"true": {
"#HCO": "brand"
}
}
},
"GH_BRAND": {
"@(2,valueBoolean)": {
"true": {
"#GH": "brand"
}
}
}
}
}
},
"tiers": {
"*": {
"priceRuleAttributes": {
"*": {
"id": {
"PR_EMPTY_PATH_NAME": {
"@(2,values[0])": "emptyPathName"
},
"PR_PATH_NAME": {
"@(2,values[0])": "pricePaths.paths.[&5].pathName"
},
"PR_TARGET_SEGMENT": {
"@(2,values)": "pricePaths.paths.[&5].customerCondition[#2].targetSegments"
},
"PR_CURR_CD": {
"@(2,values[0])": "pricePaths.paths.[&5].currencyCondition[#2].currency"
}
}
}
},
"conditions": {
"*": {
"conditionsMerch": {
"*": {
"merchandiseLevel": {
"5": {
"@(2,excludeInd)": {
"0": {
"@(4,keyItemNum)": "pricePaths.paths[&9].catalogCondition.products.yes.productList[]"
},
"1": {
"@(4,keyItemNum)": "pricePaths.paths[&9].catalogCondition.products.no.productList[]"
}
}
},
"*": {
"@(2,webCategoryId)": {
"|notfound": {
"@(4,excludeInd)": {
"0": {
"@(6,item)": "pricePaths.paths[&9].catalogCondition.products.yes.productList[]"
},
"1": {
"@(6,item)": "pricePaths.paths[&9].catalogCondition.products.no.productList[]"
}
}
},
"*": {
"@(4,excludeInd)": {
"0": {
"@(6,webCategoryId)": "pricePaths.paths[&9].catalogCondition.category.yes.categoryList[]"
},
"1": {
"@(6,webCategoryId)": "pricePaths.paths[&9].catalogCondition.category.no.categoryList[]"
}
}
}
}
}
}
}
}
}
},
"rewards": {
"*": {
"changeType": "pricePaths.paths.[&3].calculatePrice[&1].calculationType",
"changeAmount": "pricePaths.paths.[&3].calculatePrice[&1].amount",
"changePercent": "pricePaths.paths.[&3].calculatePrice[&1].percentage",
"@(4,promotionId)": "pricePaths.paths.[&3].calculatePrice[&1].RPMPromoId",
"@(4,offerId)": "pricePaths.paths.[&3].calculatePrice[&1].RPMCompId",
"@(2,priceRuleAttributes)": {
"*": {
"id": {
"PR_CURR_CD": {
"@(2,values[0])": "pricePaths.paths.[&7].calculatePrice[&4].currency"
}
}
}
}
}
}
}
}
}
},
{
"operation": "shift",
"spec": {
"*": "&",
"pricePaths": {
"paths": {
"*": {
"*": "&3.&2[&1].&",
"catalogCondition": {
"*": {
"*": {
"*": "&6.&5[&4].&3.&2[#2].&",
"$": "&6.&5[&4].&3.&2[#2].include"
}
}
}
}
}
}
}
}
]

