Related
I want to restructure json. I want an array inside a object.
Left side is the desired ouput. Right side is the current output.
I have tried the below solution but it created an extra "{,}' which I didn't wanted. Any idea on what changes I can make to my JOLT spec to get the above right side output?
After trying the above solution I got the below-
I don't want the yellow highlighted part.
My JSON Input-
{
"PURCHASE_ORDER_DISPATCH": {
"MsgData": {
"Transaction": {
"PO_POD_HDR_EVW1": {
"WG_ADDR_SEQ_NUM": 1,
"WG_PO_CNTCT_EMAIL": "PeggyMeincke#westfieldgrp.com",
"WG_REQUESTOR_EMAIL": "ZacharyEngels#westfieldgrp.com",
"WG_REQ_FIRST_NAME": "Zachary",
"WG_REQ_LAST_NAME": "Engels",
"WG_DELIVER_TO": "ZacharyEngels#westfieldgrp.com",
"BUSINESS_UNIT": "OFIC",
"PO_ID": 25052,
"VENDOR_SETID": "WCOS",
"VENDOR_ID": 35958,
"VNDR_LOC": 1,
"PO_POD_LN_EVW1": {
"WG_REQ_ID": 25694,
"WG_CATEGORY_CD": "FSSUP",
"WG_ITEM_TYPE": 0,
"WG_ACCOUNT": 641100,
"WG_DEPT_ID": 30400,
"WG_PRODUCT": "",
"BUSINESS_UNIT": "OFIC",
"PO_ID": 25052,
"WG_ASSET_GROUP": "",
"WG_CAPITALIZE": "NO",
"WG_PROFILE_ID": "",
"WG_SPLIT_TYPE": 1,
"WG_ASSET_LOC": "HOME",
"WG_PROJECT": "",
"VENDOR_SETID": "WCOS",
"VENDOR_ID": 35958,
"VNDR_LOC": 1,
"LINE_NBR": 1,
"INV_ITEM_ID": "",
"DESCR254_MIXED": "147-1518156-3620845,1GreenMountainCoffeeRoastersCaramelVanillaCreamKeurigSingle-ServeK-CupPods,LightRoastCoffee,32Count",
"UNIT_OF_MEASURE": "EA",
"ITM_ID_VNDR": "B0798CX2Q9",
"INV_ITEM_WEIGHT": 0,
"INV_ITEM_HEIGHT": 0,
"INV_ITEM_VOLUME": 0,
"INV_ITEM_LENGTH": 0,
"INV_ITEM_WIDTH": 0,
"VNDR_CATALOG_ID": "",
"MFG_ID": "",
"MFG_ITM_ID": 5000196305,
"CNTRCT_ID": "",
"VERSION_NBR": 0,
"CNTRCT_LINE_NBR": 0,
"CAT_LINE_NBR": 0,
"RELEASE_NBR": 0,
"CANCEL_STATUS": "A",
"UPN_ID": "",
"PO_POD_SHP_EVW1": {
"WG_SHIP_ADDR_TYPE": 0,
"WG_CUST_ADDR_CODE": "OFIC",
"BUSINESS_UNIT": "OFIC",
"PO_ID": 25052,
"VENDOR_SETID": "WCOS",
"VENDOR_ID": 35958,
"VNDR_LOC": 1,
"LINE_NBR": 1,
"SCHED_NBR": 1,
"DUE_DT": "2020-01-29",
"SHIPTO_ID": "OFIC",
"DESCR_SHIPTO": "OHIOFARMERSINSURANCECOMPANY",
"ADDRESS1_SHIPTO": "OHIOFARMERSINSURANCECOMPANY",
"ADDRESS2_SHIPTO": "1PARKCIRCLE",
"ADDRESS3_SHIPTO": "POBOX5001",
"ADDRESS4_SHIPTO": "",
"CITY_SHIPTO": "WESTFIELDCENTER",
"STATE_SHIPTO": "OH",
"POSTAL_SHIPTO": "44251-5001",
"COUNTRY_SHIPTO": "USA",
"PRICE_PO": 14.99,
"FREIGHT_TERMS": "FOBDEST",
"QTY_PO": 1,
"SHIP_TYPE_ID": "BEST_WAY",
"CANCEL_STATUS": "A",
"ATTN_TO": "",
"STD_ID_NUM_SHIPTO": ""
},
"PSCAMA": {
"AUDIT_ACTN": "A"
}
},
"PSCAMA": {
"AUDIT_ACTN": "A"
}
},
"PSCAMA": {
"LANGUAGE_CD": "ENG",
"AUDIT_ACTN": "A",
"BASE_LANGUAGE_CD": "ENG",
"MSG_SEQ_FLG": "",
"PROCESS_INSTANCE": 1199010,
"PUBLISH_RULE_ID": "WG_MAIN_RULE",
"MSGNODENAME": ""
}
}
}
}
}
JOLT SPEC-
[
{
"operation": "modify-overwrite-beta",
"spec": {
"*": {
"*": {
"*": {
"*": {
"requestorDetails": "=concat(#(1,WG_REQ_FIRST_NAME),' ',#(1,WG_REQ_LAST_NAME))"
}
}
}
}
}
},
{
"operation": "shift",
"spec": {
"#integrationTrackingNumber": "IntegrationEntities.integrationEntity.integrationEntityHeader.integrationTrackingNumber",
"#referenceCodeForEntity": "IntegrationEntities.integrationEntity.integrationEntityHeader.referenceCodeForEntity",
"#additionalInfo": "IntegrationEntities.integrationEntity.integrationEntityHeader.additionalInfo",
"*": {
"*": {
"*": {
"*": {
"PO_ID": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.externalId",
"#APPROVED": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.status",
"PO_AMT_TTL": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.grossTotalAmount",
"#test.test\\#test.com": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.checkoutBuyer.userEmailId",
"requestorDetails": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.requesterDetails",
"FREIGHT_TERMS": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.deliveryTermCode",
"WG_REQUESTOR_EMAIL": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.requesterDetails.userEmailId",
"WG_DELIVER_TO": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.deliveryTo.userEmailId",
"#OFIC": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.company.companyCode",
"BUSINESS_UNIT": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.businessUnit.buCode",
"PYMNT_TERMS_CD": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.paymentTermId",
"#1": [
"IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.costingSplitLevel",
"IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.costingSplitType"
],
"WG_ADDR_SEQ_NUM": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.supplierAddress.addressERPID",
"CURRENCY_CD": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.supplierCurrencyCode",
"#WG_ADDR_SEQ_NUM": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.supplierAddressERPID",
"VENDOR_ID": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.supplierERPID",
"WG_PO_CNTCT_EMAIL": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.suppPOContactEmail",
"#2": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.supplierPOContactType",
"WG_REQ_FIRST_NAME": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.requesterDetails.userFirstName",
"WG_REQ_LAST_NAME": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.requesterDetails.userLastName",
"#CURRENCY_CD": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.currency",
"#WG_DELIVER_TO": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.deliverToUser.userEmailId",
"*": {
"WG_REQ_ID": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.poDescription",
"#STANDARD": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.poType",
"LINE_NBR": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.lineNumber",
"WG_CATEGORY_CD": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.categoryCode",
"WG_ITEM_TYPE": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.itemType",
"MFG_ITM_ID": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.manufacturerPartID",
"ITM_ID_VNDR": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.supplierPartID",
"WG_ACCOUNT": {
"#": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[0].value",
"#name4": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[0].id",
"#AUTO_COMPLETE": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[0].type",
"#GL_ACCOUNT": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[0].name"
},
"WG_DEPT_ID": {
"#": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[1].value",
"#name3": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[1].id",
"#AUTO_COMPLETE": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[1].type",
"#Westfield Department": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[1].name"
},
"WG_PRODUCT": {
"#": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[2].value",
"#name6": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[2].id",
"#AUTO_COMPLETE": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[2].type",
"#Product/Parcel": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[2].name"
},
"WG_PROJECT": {
"#": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[3].value",
"#name5": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[3].id",
"#AUTO_COMPLETE": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[3].type",
"#Project Code": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[3].name"
},
"WG_ASSET_GROUP": {
"#": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[4].value",
"#name10": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[4].id",
"#AUTO_COMPLETE": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[4].type",
"#Asset Group": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[4].name"
},
"WG_CAPITALIZE": {
"#": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[5].value",
"#name9": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[5].id",
"#AUTO_COMPLETE": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[5].type",
"#Capitalize": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[5].name"
},
"WG_PROFILE_ID": {
"#": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[6].value",
"#name9": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[6].id",
"#AUTO_COMPLETE": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[6].type",
"#Profile Id": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[6].name"
},
"WG_ASSET_LOC": {
"#": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[7].value",
"#name2": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[7].id",
"#AUTO_COMPLETE": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[7].type",
"#Business Unit": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[7].name"
},
"BUSINESS_UNIT": {
"#": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[8].value",
"#name7": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[8].id",
"#AUTO_COMPLETE": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[8].type",
"#GL_ACCOUNT": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[8].name"
},
"*": {
"#WG_SHIP_ADDR_TYPE": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddressType",
"WG_SHIP_ADDR_TYPE": {
"2": {
"#(2,DESCR_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.addressName",
"#(2,ADDRESS1_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.addressLine1",
"#(2,ADDRESS2_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.addressLine2",
"#(2,ADDRESS3_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.addressLine3",
"#(2,ADDRESS4_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.addressLine4",
"#(2,CITY_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.city",
"#(2,POSTAL_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.zip",
"#(2,STATE_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.state",
"#(2,COUNTRY_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.country"
}
},
"WG_CUST_ADDR_CODE": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.addressCode",
"FREIGHT_TERMS": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.deliveryTermCode",
"SHIPTO_ID": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.locationCode.location.locationCode",
"DUE_DT": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.deliverOn",
"#DUE_DT": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.deliveryOn",
"PRICE_PO": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.marketPrice",
"QTY_PO": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.itemQuantity",
"#WG_CUST_ADDR_CODE": {
"2": {
"#(2,DESCR_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.addressName",
"#(2,ADDRESS1_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.addressLine1",
"#(2,ADDRESS2_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.addressLine2",
"#(2,ADDRESS3_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.addressLine3",
"#(2,ADDRESS4_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.addressLine4",
"#(2,CITY_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.city",
"#(2,POSTAL_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.zip",
"#(2,STATE_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.state",
"#(2,COUNTRY_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.country"
}
},
"#1": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.costingSplitType"
}
}
}
}
}
}
}
},
{
"operation": "modify-overwrite-beta",
"spec": {
"*": {
"*": {
"*": {
"*": {
"*": {
"*": {
"product": "=divide(1,#(1,itemQuantity))",
"itemTotalAmount": "=divide(#(1,marketPrice),#(1,product))",
"distributedAmount": "=divide(#(1,marketPrice),#(1,product))"
}
}
}
}
}
}
}
},
{
"operation": "shift",
"spec": {
"*": {
"*": {
"integrationEntityHeader": "&2.&1.&",
"integrationEntityDetails": {
"*": {
"externalId": "&4.&3.&2.&1.&",
"status": "&4.&3.&2.&1.&",
"poHeader": {
"poDescription": "&5.&4.&3.&2.&1.&",
"poType": "&5.&4.&3.&2.&1.&",
"grossTotalAmount": "&5.&4.&3.&2.&1.&",
"checkoutBuyer": {
"userEmailId": "&6.&5.&4.&3.&2.&1.&"
},
"requesterDetails": "&5.&4.&3.&2.&1.&",
"userEmailId": "&5.&4.&3.&2.&1.&",
"deliveryTo": {
"userEmailId": "&6.&5.&4.&3.&2.&1.&"
},
"deliveryTermCode": "&5.&4.&3.&2.&1.&",
"shipToAddressType": "&5.&4.&3.&2.&1.&",
"shipToAddress": "&5.&4.&3.&2.&1.&",
"company": "&5.&4.&3.&2.&1.&",
"businessUnit": "&5.&4.&3.&2.&1.&",
"locationCode": "&5.&4.&3.&2.&1.&",
"deliverOn": "&5.&4.&3.&2.&1.&",
"paymentTermId": "&5.&4.&3.&2.&1.&",
"costingSplitLevel": "&5.&4.&3.&2.&1.&",
"costingSplitType": "&5.&4.&3.&2.&1.&",
"supplierAddress": "&5.&4.&3.&2.&1.&",
"supplierAddressERPID": "&5.&4.&3.&2.&1.&",
"supplierCurrencyCode": "&5.&4.&3.&2.&1.&",
"supplierERPID": "&5.&4.&3.&2.&1.&",
"suppPOContactEmail": "&5.&4.&3.&2.&1.&",
"supplierPOContactType": "&5.&4.&3.&2.&1.&"
},
"items": {
"item": {
"lineNumber": "&6.&5.&4.&3.&2.&1.&",
"requesterDetails": "&6.&5.&4.&3.&2.&1.&",
"categoryCode": "&6.&5.&4.&3.&2.&1.&",
"currency": "&6.&5.&4.&3.&2.&1.&",
"deliverToUser": {
"userEmailId": "&7.&6.&5.&4.&3.&2.&1.&"
},
"deliveryOn": "&6.&5.&4.&3.&2.&1.&",
"itemTotalAmount": "&6.&5.&4.&3.&2.&1.&",
"itemType": "&6.&5.&4.&3.&2.&1.&",
"manufacturerPartID": "&6.&5.&4.&3.&2.&1.&",
"marketPrice": "&6.&5.&4.&3.&2.&1.&",
"itemQuantity": "&6.&5.&4.&3.&2.&1.&",
"shipToAddressCode": "&6.&5.&4.&3.&2.&1.&",
"shipToAddressType": "&6.&5.&4.&3.&2.&1.&",
"costingSplitType": "&6.&5.&4.&3.&2.&1.&",
"supplierPartID": "&6.&5.&4.&3.&2.&1.&",
"validCombinations": {
"itemDetails": {
"#(2,distributedAmount)": "&8.&7.&6.&5.&4.&3.&2.&1.distributedAmount",
"validRules": {
"field": {
"*": {
"id": "&11.&10.&9.&8.&7.&6.&5.&4.&3.&2.[&1].&",
"type": "&11.&10.&9.&8.&7.&6.&5.&4.&3.&2.[&1].&",
"name": "&11.&10.&9.&8.&7.&6.&5.&4.&3.&2.[&1].&",
"value": "&11.&10.&9.&8.&7.&6.&5.&4.&3.&2.[&1].&"
}
}
}
}
}
}
}
}
}
}
}
}
},
{
"operation": "cardinality",
"spec": {
"*": {
"*": {
"*": {
"*": {
"status": "ONE",
"poHeader": {
"*": "ONE",
"checkoutBuyer": {
"userEmailId": "ONE"
},
"company": {
"*": "ONE"
}
},
"items": {
"item": {
"costingSplitType": "ONE",
"validCombinations": {
"itemDetails": {
"validRules": {
"field": {
"id": "ONE",
"type": "ONE",
"name": "ONE",
"value": "ONE"
}
}
}
}
}
}
}
}
}
}
}
},
{
"operation": "modify-overwrite-beta",
"spec": {
"*": {
"*": {
"*": {
"*": {
"poHeader": {
"costingSplitLevel": "=toInteger",
"costingSplitType": "=toInteger",
"supplierPOContactType": "=toInteger"
},
"items": {
"item": {
"costingSplitType": "=toInteger"
}
}
}
}
}
}
}
}
]
You can add an extra shift transformation to the end containing a # wildcard at the right-hand-side such as
{
"operation": "shift",
"spec": {
"*": {
"*": {
"*": "&2.&1[#2].&"
}
}
}
}
I am trying to map an array of fields in JOLT. There a four fields which I want to repeat in the array.
I tried the below spec but I am getting "Failed to transform" error in output.
Any idea on what changes I need to make in JOLT spec to get the desired output?
What I tried in JOLT Spec-
Desired Output -
Input data-
{
"PURCHASE_ORDER_DISPATCH": {
"MsgData": {
"Transaction": {
"PO_POD_HDR_EVW1": {
"WG_ADDR_SEQ_NUM": 1,
"WG_PO_CNTCT_EMAIL": "PeggyMeincke#westfieldgrp.com",
"WG_REQUESTOR_EMAIL": "ZacharyEngels#westfieldgrp.com",
"WG_REQ_FIRST_NAME": "Zachary",
"WG_REQ_LAST_NAME": "Engels",
"WG_DELIVER_TO": "ZacharyEngels#westfieldgrp.com",
"BUSINESS_UNIT": "OFIC",
"PO_ID": 25052,
"VENDOR_SETID": "WCOS",
"VENDOR_ID": 35958,
"VNDR_LOC": 1,
"PO_DT": "2020-01-24",
"DB_NUMBER_BU": "",
"DESCR_BU": "OhioFarmersInsuranceCo",
"ADDRESS1_BU": "WESTFIELDCOMPANIES",
"ADDRESS2_BU": "HOMEOFFICE",
"ADDRESS3_BU": "1PARKCIRCLE",
"ADDRESS4_BU": "",
"CITY_BU": "WESTFIELDCENTER",
"STATE_BU": "OH",
"POSTAL_BU": "44251-5001",
"COUNTRY_BU": "USA",
"ADDRESS1_BILL": "",
"ADDRESS2_BILL": "",
"ADDRESS3_BILL": "",
"ADDRESS4_BILL": "",
"CITY_BILL": "",
"STATE_BILL": "",
"POSTAL_BILL": "",
"COUNTRY_BILL": "",
"CURRENCY_CD": "USD",
"TAX_EXEMPT_ID": "",
"STD_ID_NUM_VNDR": "",
"NAME1_VNDR": "AMAZONCAPITALSERVICESINC",
"ADDRESS1_VNDR": "410TERRYAVEN",
"ADDRESS2_VNDR": "",
"ADDRESS3_VNDR": "",
"ADDRESS4_VNDR": "",
"CITY_VNDR": "SEATTLE",
"STATE_VNDR": "WA",
"POSTAL_VNDR": 98109,
"COUNTRY_VNDR": "USA",
"PYMNT_TERMS_CD": "NET30",
"DESCR50_PAY": "Net30",
"BUYER_ID": 1083,
"PO_AMT_TTL": 14.99,
"TEXT254_CC1": "",
"TEXT254_CC2": "",
"VNDR_UPN_FLG": "N",
"STD_ID_NUM_VNDRGLN": "",
"STD_ID_NUM_BILLTO": "",
"ATTN_TO": "ZacharyEngels",
"PO_POD_LN_EVW1": {
"WG_REQ_ID": 25694,
"WG_CATEGORY_CD": "FSSUP",
"WG_ITEM_TYPE": 0,
"WG_ACCOUNT": 641100,
"WG_DEPT_ID": 30400,
"WG_PRODUCT": "",
"BUSINESS_UNIT": "OFIC",
"PO_ID": 25052,
"WG_ASSET_GROUP": "",
"WG_CAPITALIZE": "NO",
"WG_PROFILE_ID": "",
"WG_SPLIT_TYPE": 1,
"WG_ASSET_LOC": "HOME",
"WG_PROJECT": "",
"VENDOR_SETID": "WCOS",
"VENDOR_ID": 35958,
"VNDR_LOC": 1,
"LINE_NBR": 1,
"INV_ITEM_ID": "",
"DESCR254_MIXED": "147-1518156-3620845,1GreenMountainCoffeeRoastersCaramelVanillaCreamKeurigSingle-ServeK-CupPods,LightRoastCoffee,32Count",
"UNIT_OF_MEASURE": "EA",
"ITM_ID_VNDR": "B0798CX2Q9",
"INV_ITEM_WEIGHT": 0,
"INV_ITEM_HEIGHT": 0,
"INV_ITEM_VOLUME": 0,
"INV_ITEM_LENGTH": 0,
"INV_ITEM_WIDTH": 0,
"VNDR_CATALOG_ID": "",
"MFG_ID": "",
"MFG_ITM_ID": 5000196305,
"CNTRCT_ID": "",
"VERSION_NBR": 0,
"CNTRCT_LINE_NBR": 0,
"CAT_LINE_NBR": 0,
"RELEASE_NBR": 0,
"CANCEL_STATUS": "A",
"UPN_ID": "",
"PO_POD_SHP_EVW1": {
"WG_SHIP_ADDR_TYPE": 2,
"WG_CUST_ADDR_CODE": 2,
"BUSINESS_UNIT": "OFIC",
"PO_ID": 25052,
"VENDOR_SETID": "WCOS",
"VENDOR_ID": 35958,
"VNDR_LOC": 1,
"LINE_NBR": 1,
"SCHED_NBR": 1,
"DUE_DT": "2020-01-29",
"SHIPTO_ID": "OFIC",
"DESCR_SHIPTO": "OHIOFARMERSINSURANCECOMPANY",
"ADDRESS1_SHIPTO": "OHIOFARMERSINSURANCECOMPANY",
"ADDRESS2_SHIPTO": "1PARKCIRCLE",
"ADDRESS3_SHIPTO": "POBOX5001",
"ADDRESS4_SHIPTO": "",
"CITY_SHIPTO": "WESTFIELDCENTER",
"STATE_SHIPTO": "OH",
"POSTAL_SHIPTO": "44251-5001",
"COUNTRY_SHIPTO": "USA",
"PRICE_PO": 14.99,
"FREIGHT_TERMS": "FOBDEST",
"QTY_PO": 1,
"SHIP_TYPE_ID": "BEST_WAY",
"CANCEL_STATUS": "A",
"ATTN_TO": "",
"STD_ID_NUM_SHIPTO": ""
},
"PSCAMA": {
"AUDIT_ACTN": "A"
}
},
"PSCAMA": {
"AUDIT_ACTN": "A"
}
},
"PSCAMA": {
"LANGUAGE_CD": "ENG",
"AUDIT_ACTN": "A",
"BASE_LANGUAGE_CD": "ENG",
"MSG_SEQ_FLG": "",
"PROCESS_INSTANCE": 1199010,
"PUBLISH_RULE_ID": "WG_MAIN_RULE",
"MSGNODENAME": ""
}
}
}
}
}
JOLT Spec-
[
{
"operation": "shift",
"spec": {
"#UPSERT": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityHeader.action",
"*": {
"*": {
"*": {
"*": {
"PO_ID": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.externalId",
"#APPROVED": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.status",
"PO_AMT_TTL": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.grossTotalAmount",
"FREIGHT_TERMS": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.deliveryTermCode",
"WG_REQUESTOR_EMAIL": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.requesterDetails.userEmailId",
"WG_DELIVER_TO": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.deliverTo.userEmailId",
"#OFIC": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.company.companyCode",
"BUSINESS_UNIT": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.businessUnit.buCode",
"PYMNT_TERMS_CD": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.paymentTermId",
"#1": [
"integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.costingSplitLevel",
"integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.costingSplitType"
],
"WG_ADDR_SEQ_NUM": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.supplierAddress.addressERPID",
"CURRENCY_CD": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.supplierCurrencyCode",
"#WG_ADDR_SEQ_NUM": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.supplierAddressERPID",
"VENDOR_ID": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.supplierERPID",
"WG_PO_CNTCT_EMAIL": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.suppPOContactEmail",
"#2": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.supplierPOContactType",
"WG_REQ_FIRST_NAME": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.requesterDetails.userFirstName",
"WG_REQ_LAST_NAME": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.requesterDetails.userLastName",
"#CURRENCY_CD": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.currency",
"#WG_DELIVER_TO": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.deliverToUser.userEmailId",
"#name4": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field.id",
"#AUTO_COMPLETE": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field.type",
"#GL_ACCOUNT": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field.name",
"*": {
"WG_REQ_ID": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.poDescription",
"#STANDARD": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.poType",
"LINE_NBR": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.lineNumber",
"WG_CATEGORY_CD": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.categoryCode",
"WG_ITEM_TYPE": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.itemType",
"MFG_ITM_ID": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.manufacturerPartID",
"ITM_ID_VNDR": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.supplierPartID",
"WG_ACCOUNT": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field.value",
"BUSINESS_UNIT": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field.value",
"*": {
"#WG_SHIP_ADDR_TYPE": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddressType",
"WG_SHIP_ADDR_TYPE": {
"2": {
"#(2,DESCR_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.addressName",
"#(2,ADDRESS1_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.addressLine1",
"#(2,ADDRESS2_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.addressLine2",
"#(2,ADDRESS3_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.addressLine3",
"#(2,ADDRESS4_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.addressLine4",
"#(2,CITY_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.city",
"#(2,POSTAL_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.zip",
"#(2,STATE_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.state",
"#(2,COUNTRY_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.country"
}
},
"WG_CUST_ADDR_CODE": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.addressCode",
"FREIGHT_TERMS": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.deliveryTermCode",
"SHIPTO_ID": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.locationCode.location.locationCode",
"DUE_DT": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.deliverOn",
"#DUE_DT": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.deliveryOn",
"PRICE_PO": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.marketPrice",
"QTY_PO": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.itemQuantity",
"#WG_CUST_ADDR_CODE": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddressCode",
"#WG_SHIP_ADDR_TYPE": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddressType",
"#1": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.costingSplitType",
"#WG_CUST_ADDR_CODE": {
"2": {
"#(2,DESCR_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.addressName",
"#(2,ADDRESS1_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.addressLine1",
"#(2,ADDRESS2_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.addressLine2",
"#(2,ADDRESS3_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.addressLine3",
"#(2,ADDRESS4_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.addressLine4",
"#(2,CITY_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.city",
"#(2,POSTAL_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.zip",
"#(2,STATE_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.state",
"#(2,COUNTRY_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.country"
}
}
}
}
}
}
}
}
}
},
{
"operation": "shift",
"spec": {
"*": {
"*": {
"*": {
"integrationEntityHeader": "&3.&2.&1.&",
"integrationEntityDetails": {
"*": {
"externalId": "&5.&4.&3.&2.&1.&",
"status": "&5.&4.&3.&2.&1.&",
"poHeader": {
"poDescription": "&6.&5.&4.&3.&2.&1.&",
"poType": "&6.&5.&4.&3.&2.&1.&",
"grossTotalAmount": "&6.&5.&4.&3.&2.&1.&",
"deliveryTermCode": "&6.&5.&4.&3.&2.&1.&",
"shipToAddressType": "&6.&5.&4.&3.&2.&1.&",
"shipToAddress": "&6.&5.&4.&3.&2.&1.&",
"company": "&6.&5.&4.&3.&2.&1.&",
"businessUnit": "&6.&5.&4.&3.&2.&1.&",
"locationCode": "&6.&5.&4.&3.&2.&1.&",
"deliverOn": "&6.&5.&4.&3.&2.&1.&",
"paymentTermId": "&6.&5.&4.&3.&2.&1.&",
"costingSplitLevel": "&6.&5.&4.&3.&2.&1.&",
"costingSplitType": "&6.&5.&4.&3.&2.&1.&",
"supplierAddress": "&6.&5.&4.&3.&2.&1.&",
"supplierAddressERPID": "&6.&5.&4.&3.&2.&1.&",
"supplierCurrencyCode": "&6.&5.&4.&3.&2.&1.&",
"supplierERPID": "&6.&5.&4.&3.&2.&1.&",
"suppPOContactEmail": "&6.&5.&4.&3.&2.&1.&",
"supplierPOContactType": "&6.&5.&4.&3.&2.&1.&"
},
"items": {
"item": {
"lineNumber": "&7.&6.&5.&4.&3.&2.&1.&",
"requesterDetails": "&7.&6.&5.&4.&3.&2.&1.&",
"categoryCode": "&7.&6.&5.&4.&3.&2.&1.&",
"currency": "&7.&6.&5.&4.&3.&2.&1.&",
"deliverToUser": {
"userEmailId": "&8.&7.&6.&5.&4.&3.&2.&1.&"
},
"deliverOn": "&7.&6.&5.&4.&3.&2.&1.&",
"itemType": "&7.&6.&5.&4.&3.&2.&1.&",
"manufacturerPartID": "&7.&6.&5.&4.&3.&2.&1.&",
"marketPrice": "&7.&6.&5.&4.&3.&2.&1.&",
"itemQuantity": "&7.&6.&5.&4.&3.&2.&1.&",
"shipToAddressCode": "&7.&6.&5.&4.&3.&2.&1.&",
"shipToAddressType": "&7.&6.&5.&4.&3.&2.&1.&",
"costingSplitType": "&7.&6.&5.&4.&3.&2.&1.&",
"supplierPartID": "&7.&6.&5.&4.&3.&2.&1.&",
"validCombinations": {
"itemDetails": {
"validRules": {
"field": {
"id": "&11.&10.&9.&8.&7.&6.&5.&4.&3.&2.&1.&",
"type": "&11.&10.&9.&8.&7.&6.&5.&4.&3.&2.&1.&",
"name": "&11.&10.&9.&8.&7.&6.&5.&4.&3.&2.&1.&",
"value": "&11.&10.&9.&8.&7.&6.&5.&4.&3.&2.&1.&"
}
}
}
}
}
}
}
}
}
}
}
}
},
{
"operation": "cardinality",
"spec": {
"*": {
"*": {
"*": {
"*": {
"*": {
"status": "ONE",
"poHeader": {
"*": "ONE",
"company": {
"*": "ONE"
}
},
"items": {
"item": {
"costingSplitType": "ONE",
"validCombinations": {
"itemDetails": {
"validRules": {
"field": {
"id": "ONE",
"type": "ONE",
"name": "ONE",
"value": "ONE"
}
}
}
}
}
}
}
}
}
}
}
}
},
{
"operation": "modify-overwrite-beta",
"spec": {
"*": {
"*": {
"*": {
"*": {
"*": {
"poHeader": {
"costingSplitLevel": "=toInteger",
"costingSplitType": "=toInteger",
"supplierPOContactType": "=toInteger"
},
"items": {
"item": {
"costingSplitType": "=toInteger"
}
}
}
}
}
}
}
}
},
{
"operation": "modify-overwrite-beta",
"spec": {
"*": {
"*": {
"*": {
"*": {
"*": {
"*": {
"*": {
"product": "=divide(1,#(1,itemQuantity))",
"itemTotalAmount": "=divide(#(1,marketPrice),#(1,product))"
}
}
}
}
}
}
}
}
}
]
You can use this spec:
[
{
"operation": "shift",
"spec": {
"#UPSERT": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityHeader.action",
"*": {
"*": {
"*": {
"*": {
"PO_ID": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.externalId",
"#APPROVED": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.status",
"PO_AMT_TTL": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.grossTotalAmount",
"FREIGHT_TERMS": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.deliveryTermCode",
"WG_REQUESTOR_EMAIL": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.requesterDetails.userEmailId",
"WG_DELIVER_TO": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.deliverTo.userEmailId",
"#OFIC": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.company.companyCode",
"BUSINESS_UNIT": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.businessUnit.buCode",
"PYMNT_TERMS_CD": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.paymentTermId",
"#1": [
"integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.costingSplitLevel",
"integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.costingSplitType"
],
"WG_ADDR_SEQ_NUM": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.supplierAddress.addressERPID",
"CURRENCY_CD": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.supplierCurrencyCode",
"#WG_ADDR_SEQ_NUM": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.supplierAddressERPID",
"VENDOR_ID": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.supplierERPID",
"WG_PO_CNTCT_EMAIL": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.suppPOContactEmail",
"#2": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.supplierPOContactType",
"WG_REQ_FIRST_NAME": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.requesterDetails.userFirstName",
"WG_REQ_LAST_NAME": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.requesterDetails.userLastName",
"#CURRENCY_CD": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.currency",
"#WG_DELIVER_TO": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.deliverToUser.userEmailId",
"*": {
"WG_REQ_ID": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.poDescription",
"#STANDARD": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.poType",
"LINE_NBR": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.lineNumber",
"WG_CATEGORY_CD": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.categoryCode",
"WG_ITEM_TYPE": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.itemType",
"MFG_ITM_ID": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.manufacturerPartID",
"ITM_ID_VNDR": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.supplierPartID",
"WG_ACCOUNT": {
"#": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[0].value",
"#name4": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[0].id",
"#AUTO_COMPLETE": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[0].type",
"#GL_ACCOUNT": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[0].name"
},
"BUSINESS_UNIT": {
"#": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[1].value",
"#name4": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[1].id",
"#AUTO_COMPLETE": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[1].type",
"#GL_ACCOUNT": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[1].name"
},
"*": {
"#WG_SHIP_ADDR_TYPE": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddressType",
"WG_SHIP_ADDR_TYPE": {
"2": {
"#(2,DESCR_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.addressName",
"#(2,ADDRESS1_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.addressLine1",
"#(2,ADDRESS2_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.addressLine2",
"#(2,ADDRESS3_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.addressLine3",
"#(2,ADDRESS4_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.addressLine4",
"#(2,CITY_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.city",
"#(2,POSTAL_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.zip",
"#(2,STATE_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.state",
"#(2,COUNTRY_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.country"
}
},
"WG_CUST_ADDR_CODE": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.addressCode",
"FREIGHT_TERMS": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.deliveryTermCode",
"SHIPTO_ID": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.locationCode.location.locationCode",
"DUE_DT": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.deliverOn",
"#DUE_DT": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.deliveryOn",
"PRICE_PO": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.marketPrice",
"QTY_PO": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.itemQuantity",
"#WG_CUST_ADDR_CODE": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddressCode",
"#WG_SHIP_ADDR_TYPE": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddressType",
"#1": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.costingSplitType",
"#WG_CUST_ADDR_CODE": {
"2": {
"#(2,DESCR_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.addressName",
"#(2,ADDRESS1_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.addressLine1",
"#(2,ADDRESS2_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.addressLine2",
"#(2,ADDRESS3_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.addressLine3",
"#(2,ADDRESS4_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.addressLine4",
"#(2,CITY_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.city",
"#(2,POSTAL_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.zip",
"#(2,STATE_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.state",
"#(2,COUNTRY_SHIPTO)": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.country"
}
}
}
}
}
}
}
}
}
},
{
"operation": "shift",
"spec": {
"*": {
"*": {
"*": {
"integrationEntityHeader": "&3.&2.&1.&",
"integrationEntityDetails": {
"*": {
"externalId": "&5.&4.&3.&2.&1.&",
"status": "&5.&4.&3.&2.&1.&",
"poHeader": {
"poDescription": "&6.&5.&4.&3.&2.&1.&",
"poType": "&6.&5.&4.&3.&2.&1.&",
"grossTotalAmount": "&6.&5.&4.&3.&2.&1.&",
"deliveryTermCode": "&6.&5.&4.&3.&2.&1.&",
"shipToAddressType": "&6.&5.&4.&3.&2.&1.&",
"shipToAddress": "&6.&5.&4.&3.&2.&1.&",
"company": "&6.&5.&4.&3.&2.&1.&",
"businessUnit": "&6.&5.&4.&3.&2.&1.&",
"locationCode": "&6.&5.&4.&3.&2.&1.&",
"deliverOn": "&6.&5.&4.&3.&2.&1.&",
"paymentTermId": "&6.&5.&4.&3.&2.&1.&",
"costingSplitLevel": "&6.&5.&4.&3.&2.&1.&",
"costingSplitType": "&6.&5.&4.&3.&2.&1.&",
"supplierAddress": "&6.&5.&4.&3.&2.&1.&",
"supplierAddressERPID": "&6.&5.&4.&3.&2.&1.&",
"supplierCurrencyCode": "&6.&5.&4.&3.&2.&1.&",
"supplierERPID": "&6.&5.&4.&3.&2.&1.&",
"suppPOContactEmail": "&6.&5.&4.&3.&2.&1.&",
"supplierPOContactType": "&6.&5.&4.&3.&2.&1.&"
},
"items": {
"item": {
"lineNumber": "&7.&6.&5.&4.&3.&2.&1.&",
"requesterDetails": "&7.&6.&5.&4.&3.&2.&1.&",
"categoryCode": "&7.&6.&5.&4.&3.&2.&1.&",
"currency": "&7.&6.&5.&4.&3.&2.&1.&",
"deliverToUser": {
"userEmailId": "&8.&7.&6.&5.&4.&3.&2.&1.&"
},
"deliverOn": "&7.&6.&5.&4.&3.&2.&1.&",
"itemType": "&7.&6.&5.&4.&3.&2.&1.&",
"manufacturerPartID": "&7.&6.&5.&4.&3.&2.&1.&",
"marketPrice": "&7.&6.&5.&4.&3.&2.&1.&",
"itemQuantity": "&7.&6.&5.&4.&3.&2.&1.&",
"shipToAddressCode": "&7.&6.&5.&4.&3.&2.&1.&",
"shipToAddressType": "&7.&6.&5.&4.&3.&2.&1.&",
"costingSplitType": "&7.&6.&5.&4.&3.&2.&1.&",
"supplierPartID": "&7.&6.&5.&4.&3.&2.&1.&",
"validCombinations": {
"itemDetails": {
"validRules": {
"field": {
"*": {
"id": "&12.&11.&10.&9.&8.&7.&6.&5.&4.&3.&2.[&1].&",
"type": "&12.&11.&10.&9.&8.&7.&6.&5.&4.&3.&2.[&1].&",
"name": "&12.&11.&10.&9.&8.&7.&6.&5.&4.&3.&2.[&1].&",
"value": "&12.&11.&10.&9.&8.&7.&6.&5.&4.&3.&2.[&1].&"
}
}
}
}
}
}
}
}
}
}
}
}
}
},
{
"operation": "cardinality",
"spec": {
"*": {
"*": {
"*": {
"*": {
"*": {
"status": "ONE",
"poHeader": {
"*": "ONE",
"company": {
"*": "ONE"
}
},
"items": {
"item": {
"costingSplitType": "ONE",
"validCombinations": {
"itemDetails": {
"validRules": {
"field": {
"id": "ONE",
"type": "ONE",
"name": "ONE",
"value": "ONE"
}
}
}
}
}
}
}
}
}
}
}
}
},
{
"operation": "modify-overwrite-beta",
"spec": {
"*": {
"*": {
"*": {
"*": {
"*": {
"poHeader": {
"costingSplitLevel": "=toInteger",
"costingSplitType": "=toInteger",
"supplierPOContactType": "=toInteger"
},
"items": {
"item": {
"costingSplitType": "=toInteger"
}
}
}
}
}
}
}
}
},
{
"operation": "modify-overwrite-beta",
"spec": {
"*": {
"*": {
"*": {
"*": {
"*": {
"*": {
"*": {
"product": "=divide(1,#(1,itemQuantity))",
"itemTotalAmount": "=divide(#(1,marketPrice),#(1,product))"
}
}
}
}
}
}
}
}
}
]
You can add your keys that you want create object from it like the below code snippet in the spec:
{
"WG_ACCOUNT": {
"#": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[0].value",
"#name4": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[0].id",
"#AUTO_COMPLETE": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[0].type",
"#GL_ACCOUNT": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[0].name"
},
"BUSINESS_UNIT": {
"#": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[1].value",
"#name4": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[1].id",
"#AUTO_COMPLETE": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[1].type",
"#GL_ACCOUNT": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[1].name"
}
}
output:
{
"field": [
{
"id": "name4",
"type": "AUTO_COMPLETE",
"name": "GL_ACCOUNT",
"value": 641100
},
{
"id": "name4",
"type": "AUTO_COMPLETE",
"name": "GL_ACCOUNT",
"value": "OFIC"
}
]
}
I have mapped a field userEmailid in JOLT but that field is not showing put in the output.
Main Snippet :
"WG_REQUESTOR_EMAIL": "integration-inbound:IntegrationDetails.integrationEntities.
integrationEntity.integrationEntityDetails.poDetails.items.item.requesterDetails.
userEmailId",
Input :
{
"PURCHASE_ORDER_DISPATCH": {
"MsgData": {
"Transaction": {
"PO_POD_HDR_EVW1": {
"WG_ADDR_SEQ_NUM": 1,
"WG_PO_CNTCT_EMAIL": "PeggyMeincke#westfieldgrp.com",
"WG_REQUESTOR_EMAIL": "ZacharyEngels#westfieldgrp.com",
"WG_REQ_FIRST_NAME": "Zachary",
"WG_REQ_LAST_NAME": "Engels",
"WG_DELIVER_TO": "ZacharyEngels#westfieldgrp.com",
"BUSINESS_UNIT": "OFIC",
"PO_ID": 25052,
"VENDOR_SETID": "WCOS",
"VENDOR_ID": 35958,
"VNDR_LOC": 1,
"PO_DT": "2020-01-24",
"DB_NUMBER_BU": "",
"DESCR_BU": "OhioFarmersInsuranceCo",
"ADDRESS1_BU": "WESTFIELDCOMPANIES",
"ADDRESS2_BU": "HOMEOFFICE",
"ADDRESS3_BU": "1PARKCIRCLE",
"ADDRESS4_BU": "",
"CITY_BU": "WESTFIELDCENTER",
"STATE_BU": "OH",
"POSTAL_BU": "44251-5001",
"COUNTRY_BU": "USA",
"ADDRESS1_BILL": "",
"ADDRESS2_BILL": "",
"ADDRESS3_BILL": "",
"ADDRESS4_BILL": "",
"CITY_BILL": "",
"STATE_BILL": "",
"POSTAL_BILL": "",
"COUNTRY_BILL": "",
"CURRENCY_CD": "USD",
"TAX_EXEMPT_ID": "",
"STD_ID_NUM_VNDR": "",
"NAME1_VNDR": "AMAZONCAPITALSERVICESINC",
"ADDRESS1_VNDR": "410TERRYAVEN",
"ADDRESS2_VNDR": "",
"ADDRESS3_VNDR": "",
"ADDRESS4_VNDR": "",
"CITY_VNDR": "SEATTLE",
"STATE_VNDR": "WA",
"POSTAL_VNDR": 98109,
"COUNTRY_VNDR": "USA",
"PYMNT_TERMS_CD": "NET30",
"DESCR50_PAY": "Net30",
"BUYER_ID": 1083,
"PO_AMT_TTL": 14.99,
"TEXT254_CC1": "",
"TEXT254_CC2": "",
"VNDR_UPN_FLG": "N",
"STD_ID_NUM_VNDRGLN": "",
"STD_ID_NUM_BILLTO": "",
"ATTN_TO": "ZacharyEngels",
"PO_POD_LN_EVW1": {
"WG_REQ_ID": 25694,
"WG_CATEGORY_CD": "FSSUP",
"WG_ITEM_TYPE": 0,
"WG_ACCOUNT": 641100,
"WG_DEPT_ID": 30400,
"WG_PRODUCT": "",
"BUSINESS_UNIT": "OFIC",
"PO_ID": 25052,
"WG_ASSET_GROUP": "",
"WG_CAPITALIZE": "NO",
"WG_PROFILE_ID": "",
"WG_SPLIT_TYPE": 1,
"WG_ASSET_LOC": "HOME",
"WG_PROJECT": "",
"VENDOR_SETID": "WCOS",
"VENDOR_ID": 35958,
"VNDR_LOC": 1,
"LINE_NBR": 1,
"INV_ITEM_ID": "",
"DESCR254_MIXED": "147-1518156-3620845,1GreenMountainCoffeeRoastersCaramelVanillaCreamKeurigSingle-ServeK-CupPods,LightRoastCoffee,32Count",
"UNIT_OF_MEASURE": "EA",
"ITM_ID_VNDR": "B0798CX2Q9",
"INV_ITEM_WEIGHT": 0,
"INV_ITEM_HEIGHT": 0,
"INV_ITEM_VOLUME": 0,
"INV_ITEM_LENGTH": 0,
"INV_ITEM_WIDTH": 0,
"VNDR_CATALOG_ID": "",
"MFG_ID": "",
"MFG_ITM_ID": 5000196305,
"CNTRCT_ID": "",
"VERSION_NBR": 0,
"CNTRCT_LINE_NBR": 0,
"CAT_LINE_NBR": 0,
"RELEASE_NBR": 0,
"CANCEL_STATUS": "A",
"UPN_ID": "",
"PO_POD_SHP_EVW1": {
"WG_SHIP_ADDR_TYPE": 0,
"WG_CUST_ADDR_CODE": "OFIC",
"BUSINESS_UNIT": "OFIC",
"PO_ID": 25052,
"VENDOR_SETID": "WCOS",
"VENDOR_ID": 35958,
"VNDR_LOC": 1,
"LINE_NBR": 1,
"SCHED_NBR": 1,
"DUE_DT": "2020-01-29",
"SHIPTO_ID": "OFIC",
"DESCR_SHIPTO": "OHIOFARMERSINSURANCECOMPANY",
"ADDRESS1_SHIPTO": "OHIOFARMERSINSURANCECOMPANY",
"ADDRESS2_SHIPTO": "1PARKCIRCLE",
"ADDRESS3_SHIPTO": "POBOX5001",
"ADDRESS4_SHIPTO": "",
"CITY_SHIPTO": "WESTFIELDCENTER",
"STATE_SHIPTO": "OH",
"POSTAL_SHIPTO": "44251-5001",
"COUNTRY_SHIPTO": "USA",
"PRICE_PO": 14.99,
"FREIGHT_TERMS": "FOBDEST",
"QTY_PO": 1,
"SHIP_TYPE_ID": "BEST_WAY",
"CANCEL_STATUS": "A",
"ATTN_TO": "",
"STD_ID_NUM_SHIPTO": ""
},
"PSCAMA": {
"AUDIT_ACTN": "A"
}
},
"PSCAMA": {
"AUDIT_ACTN": "A"
}
},
"PSCAMA": {
"LANGUAGE_CD": "ENG",
"AUDIT_ACTN": "A",
"BASE_LANGUAGE_CD": "ENG",
"MSG_SEQ_FLG": "",
"PROCESS_INSTANCE": 1199010,
"PUBLISH_RULE_ID": "WG_MAIN_RULE",
"MSGNODENAME": ""
}
}
}
}
}
JOLT Spec :
[
{
"operation": "shift",
"spec": {
"#UPSERT": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityHeader.action",
"*": {
"*": {
"*": {
"*": {
"PO_ID": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.externalId",
"#APPROVED": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.status",
"PO_AMT_TTL": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.grossTotalAmount",
"WG_REQUESTOR_EMAIL": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.requesterDetails.userEmailId",
"*": {
"WG_REQ_ID": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.poDescription",
"#STANDARD": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.poType",
"*": {
"FREIGHT_TERMS": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.deliveryTermCode"
}
}
}
}
}
}
}
},
{
"operation": "shift",
"spec": {
"*": {
"*": {
"*": {
"integrationEntityHeader": "&3.&2.&1.&",
"integrationEntityDetails": {
"*": {
"externalId": "&5.&4.&3.&2.&1.&",
"status": "&5.&4.&3.&2.&1.&",
"poHeader": "&5.&4.&3.&2.&1.&"
}
}
}
}
}
}
},
{
"operation": "cardinality",
"spec": {
"*": {
"*": {
"*": {
"*": {
"*": {
"status": "ONE",
"poHeader": {
"*": "ONE"
}
}
}
}
}
}
}
}
]
Output :
{
"integration-inbound:IntegrationDetails": {
"integrationEntities": {
"integrationEntity": {
"integrationEntityHeader": {
"action": "UPSERT"
},
"integrationEntityDetails": {
"poDetails": {
"externalId": 25052,
"status": "APPROVED",
"poHeader": {
"poType": "STANDARD",
"grossTotalAmount": 14.99,
"poDescription": 25694,
"deliveryTermCode": "FOBDEST"
}
}
}
}
}
}
}
You can use this spec:
[
{
"operation": "shift",
"spec": {
"#UPSERT": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityHeader.action",
"*": {
"*": {
"*": {
"*": {
"PO_ID": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.externalId",
"#APPROVED": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.status",
"PO_AMT_TTL": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.grossTotalAmount",
"WG_REQUESTOR_EMAIL": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.requesterDetails.userEmailId",
"*": {
"WG_REQ_ID": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.poDescription",
"#STANDARD": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.poType",
"*": {
"FREIGHT_TERMS": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.deliveryTermCode"
}
}
}
}
}
}
}
},
{
"operation": "shift",
"spec": {
"*": {
"*": {
"*": {
"integrationEntityHeader": "&3.&2.&1.&",
"*": {
"*": {
"externalId": "&5.&4.&3.&2.&1.&",
"status": "&5.&4.&3.&2.&1.&",
"poHeader": "&5.&4.&3.&2.&1.&",
"items": "&5.&4.&3.&2.&1.&"
}
}
}
}
}
}
},
{
"operation": "cardinality",
"spec": {
"*": {
"*": {
"*": {
"*": {
"*": {
"status": "ONE",
"poHeader": {
"*": "ONE"
}
}
}
}
}
}
}
}
]
You should convert the second shift transformation to this one
{
"operation": "shift",
"spec": {
"*": {
"*": {
"*": {
"integrationEntityH*": "&3.&2.&1.&",
"integrationEntityD*": {
"*": {
"*": "&5.&4.&3.&2.&1.&"
}
}
}
}
}
}
}
in order to include the object "items" as well.
If the order of the object matters, then use the following, in which each of them written individually, instead of the above one
{
"operation": "shift",
"spec": {
"*": {
"*": {
"*": {
"integrationEntityH*": "&3.&2.&1.&",
"integrationEntityD*": {
"*": {
"externalId": "&5.&4.&3.&2.&1.&",
"status": "&5.&4.&3.&2.&1.&",
"poHeader": "&5.&4.&3.&2.&1.&",
"items": "&5.&4.&3.&2.&1.&"
}
}
}
}
}
}
}
I want my ouput in such a way that integration Entity comes inside integrationEntities.
Left side is the current output. Right side is the desired output.
I also tried the below but it didn't worked.
What changes do I need to make in my spec to get the desired output like the right side? Any idea?
My JSON input :
{
"PURCHASE_ORDER_DISPATCH": {
"MsgData": {
"Transaction": {
"PO_POD_HDR_EVW1": {
"WG_ADDR_SEQ_NUM": 1,
"WG_PO_CNTCT_EMAIL": "PeggyMeincke#westfieldgrp.com",
"WG_REQUESTOR_EMAIL": "ZacharyEngels#westfieldgrp.com",
"WG_REQ_FIRST_NAME": "Zachary",
"WG_REQ_LAST_NAME": "Engels",
"WG_DELIVER_TO": "ZacharyEngels#westfieldgrp.com",
"BUSINESS_UNIT": "OFIC",
"PO_ID": 25052,
"VENDOR_SETID": "WCOS",
"VENDOR_ID": 35958,
"VNDR_LOC": 1,
"PO_POD_LN_EVW1": {
"WG_REQ_ID": 25694,
"WG_CATEGORY_CD": "FSSUP",
"WG_ITEM_TYPE": 0,
"WG_ACCOUNT": 641100,
"WG_DEPT_ID": 30400,
"WG_PRODUCT": "",
"BUSINESS_UNIT": "OFIC",
"PO_ID": 25052,
"WG_ASSET_GROUP": "",
"WG_CAPITALIZE": "NO",
"WG_PROFILE_ID": "",
"WG_SPLIT_TYPE": 1,
"WG_ASSET_LOC": "HOME",
"WG_PROJECT": "",
"VENDOR_SETID": "WCOS",
"VENDOR_ID": 35958,
"VNDR_LOC": 1,
"LINE_NBR": 1,
"INV_ITEM_ID": "",
"DESCR254_MIXED": "147-1518156-3620845,1GreenMountainCoffeeRoastersCaramelVanillaCreamKeurigSingle-ServeK-CupPods,LightRoastCoffee,32Count",
"UNIT_OF_MEASURE": "EA",
"ITM_ID_VNDR": "B0798CX2Q9",
"INV_ITEM_WEIGHT": 0,
"INV_ITEM_HEIGHT": 0,
"INV_ITEM_VOLUME": 0,
"INV_ITEM_LENGTH": 0,
"INV_ITEM_WIDTH": 0,
"VNDR_CATALOG_ID": "",
"MFG_ID": "",
"MFG_ITM_ID": 5000196305,
"CNTRCT_ID": "",
"VERSION_NBR": 0,
"CNTRCT_LINE_NBR": 0,
"CAT_LINE_NBR": 0,
"RELEASE_NBR": 0,
"CANCEL_STATUS": "A",
"UPN_ID": "",
"PO_POD_SHP_EVW1": {
"WG_SHIP_ADDR_TYPE": 0,
"WG_CUST_ADDR_CODE": "OFIC",
"BUSINESS_UNIT": "OFIC",
"PO_ID": 25052,
"VENDOR_SETID": "WCOS",
"VENDOR_ID": 35958,
"VNDR_LOC": 1,
"LINE_NBR": 1,
"SCHED_NBR": 1,
"DUE_DT": "2020-01-29",
"SHIPTO_ID": "OFIC",
"DESCR_SHIPTO": "OHIOFARMERSINSURANCECOMPANY",
"ADDRESS1_SHIPTO": "OHIOFARMERSINSURANCECOMPANY",
"ADDRESS2_SHIPTO": "1PARKCIRCLE",
"ADDRESS3_SHIPTO": "POBOX5001",
"ADDRESS4_SHIPTO": "",
"CITY_SHIPTO": "WESTFIELDCENTER",
"STATE_SHIPTO": "OH",
"POSTAL_SHIPTO": "44251-5001",
"COUNTRY_SHIPTO": "USA",
"PRICE_PO": 14.99,
"FREIGHT_TERMS": "FOBDEST",
"QTY_PO": 1,
"SHIP_TYPE_ID": "BEST_WAY",
"CANCEL_STATUS": "A",
"ATTN_TO": "",
"STD_ID_NUM_SHIPTO": ""
},
"PSCAMA": {
"AUDIT_ACTN": "A"
}
},
"PSCAMA": {
"AUDIT_ACTN": "A"
}
},
"PSCAMA": {
"LANGUAGE_CD": "ENG",
"AUDIT_ACTN": "A",
"BASE_LANGUAGE_CD": "ENG",
"MSG_SEQ_FLG": "",
"PROCESS_INSTANCE": 1199010,
"PUBLISH_RULE_ID": "WG_MAIN_RULE",
"MSGNODENAME": ""
}
}
}
}
}
JOLT Spec :
[
{
"operation": "modify-overwrite-beta",
"spec": {
"*": {
"*": {
"*": {
"*": {
"requestorDetails": "=concat(#(1,WG_REQ_FIRST_NAME),' ',#(1,WG_REQ_LAST_NAME))"
}
}
}
}
}
},
{
"operation": "shift",
"spec": {
"#integrationTrackingNumber": "IntegrationEntities.integrationEntity.integrationEntityHeader.integrationTrackingNumber",
"#referenceCodeForEntity": "IntegrationEntities.integrationEntity.integrationEntityHeader.referenceCodeForEntity",
"#additionalInfo": "IntegrationEntities.integrationEntity.integrationEntityHeader.additionalInfo",
"*": {
"*": {
"*": {
"*": {
"PO_ID": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.externalId",
"#APPROVED": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.status",
"PO_AMT_TTL": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.grossTotalAmount",
"#test.test\\#test.com": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.checkoutBuyer.userEmailId",
"requestorDetails": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.requesterDetails",
"FREIGHT_TERMS": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.deliveryTermCode",
"WG_REQUESTOR_EMAIL": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.requesterDetails.userEmailId",
"WG_DELIVER_TO": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.deliveryTo.userEmailId",
"#OFIC": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.company.companyCode",
"BUSINESS_UNIT": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.businessUnit.buCode",
"PYMNT_TERMS_CD": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.paymentTermId",
"#1": [
"IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.costingSplitLevel",
"IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.costingSplitType"
],
"WG_ADDR_SEQ_NUM": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.supplierAddress.addressERPID",
"CURRENCY_CD": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.supplierCurrencyCode",
"#WG_ADDR_SEQ_NUM": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.supplierAddressERPID",
"VENDOR_ID": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.supplierERPID",
"WG_PO_CNTCT_EMAIL": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.suppPOContactEmail",
"#2": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.supplierPOContactType",
"WG_REQ_FIRST_NAME": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.requesterDetails.userFirstName",
"WG_REQ_LAST_NAME": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.requesterDetails.userLastName",
"#CURRENCY_CD": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.currency",
"#WG_DELIVER_TO": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.deliverToUser.userEmailId",
"*": {
"WG_REQ_ID": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.poDescription",
"#STANDARD": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.poType",
"LINE_NBR": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.lineNumber",
"WG_CATEGORY_CD": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.categoryCode",
"WG_ITEM_TYPE": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.itemType",
"MFG_ITM_ID": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.manufacturerPartID",
"ITM_ID_VNDR": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.supplierPartID",
"WG_ACCOUNT": {
"#": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[0].value",
"#name4": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[0].id",
"#AUTO_COMPLETE": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[0].type",
"#GL_ACCOUNT": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[0].name"
},
"WG_DEPT_ID": {
"#": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[1].value",
"#name3": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[1].id",
"#AUTO_COMPLETE": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[1].type",
"#Westfield Department": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[1].name"
},
"WG_PRODUCT": {
"#": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[2].value",
"#name6": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[2].id",
"#AUTO_COMPLETE": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[2].type",
"#Product/Parcel": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[2].name"
},
"WG_PROJECT": {
"#": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[3].value",
"#name5": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[3].id",
"#AUTO_COMPLETE": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[3].type",
"#Project Code": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[3].name"
},
"WG_ASSET_GROUP": {
"#": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[4].value",
"#name10": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[4].id",
"#AUTO_COMPLETE": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[4].type",
"#Asset Group": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[4].name"
},
"WG_CAPITALIZE": {
"#": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[5].value",
"#name9": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[5].id",
"#AUTO_COMPLETE": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[5].type",
"#Capitalize": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[5].name"
},
"WG_PROFILE_ID": {
"#": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[6].value",
"#name9": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[6].id",
"#AUTO_COMPLETE": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[6].type",
"#Profile Id": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[6].name"
},
"WG_ASSET_LOC": {
"#": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[7].value",
"#name2": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[7].id",
"#AUTO_COMPLETE": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[7].type",
"#Business Unit": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[7].name"
},
"BUSINESS_UNIT": {
"#": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[8].value",
"#name7": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[8].id",
"#AUTO_COMPLETE": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[8].type",
"#GL_ACCOUNT": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.validCombinations.itemDetails.validRules.field[8].name"
},
"*": {
"#WG_SHIP_ADDR_TYPE": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddressType",
"WG_SHIP_ADDR_TYPE": {
"2": {
"#(2,DESCR_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.addressName",
"#(2,ADDRESS1_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.addressLine1",
"#(2,ADDRESS2_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.addressLine2",
"#(2,ADDRESS3_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.addressLine3",
"#(2,ADDRESS4_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.addressLine4",
"#(2,CITY_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.city",
"#(2,POSTAL_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.zip",
"#(2,STATE_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.state",
"#(2,COUNTRY_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.country"
}
},
"WG_CUST_ADDR_CODE": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.shipToAddress.addressCode",
"FREIGHT_TERMS": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.deliveryTermCode",
"SHIPTO_ID": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.locationCode.location.locationCode",
"DUE_DT": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.deliverOn",
"#DUE_DT": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.deliveryOn",
"PRICE_PO": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.marketPrice",
"QTY_PO": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.itemQuantity",
"#WG_CUST_ADDR_CODE": {
"2": {
"#(2,DESCR_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.addressName",
"#(2,ADDRESS1_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.addressLine1",
"#(2,ADDRESS2_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.addressLine2",
"#(2,ADDRESS3_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.addressLine3",
"#(2,ADDRESS4_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.addressLine4",
"#(2,CITY_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.city",
"#(2,POSTAL_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.zip",
"#(2,STATE_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.state",
"#(2,COUNTRY_SHIPTO)": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddress.country"
}
},
"#1": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.costingSplitType"
}
}
}
}
}
}
}
},
{
"operation": "modify-overwrite-beta",
"spec": {
"*": {
"*": {
"*": {
"*": {
"*": {
"*": {
"product": "=divide(1,#(1,itemQuantity))",
"itemTotalAmount": "=divide(#(1,marketPrice),#(1,product))",
"distributedAmount": "=divide(#(1,marketPrice),#(1,product))"
}
}
}
}
}
}
}
},
{
"operation": "shift",
"spec": {
"*": {
"*": {
"integrationEntityHeader": "&2.&1.&",
"integrationEntityDetails": {
"*": {
"externalId": "&4.&3.&2.&1.&",
"status": "&4.&3.&2.&1.&",
"poHeader": {
"poDescription": "&5.&4.&3.&2.&1.&",
"poType": "&5.&4.&3.&2.&1.&",
"grossTotalAmount": "&5.&4.&3.&2.&1.&",
"checkoutBuyer": {
"userEmailId": "&6.&5.&4.&3.&2.&1.&"
},
"requesterDetails": "&5.&4.&3.&2.&1.&",
"userEmailId": "&5.&4.&3.&2.&1.&",
"deliveryTo": {
"userEmailId": "&6.&5.&4.&3.&2.&1.&"
},
"deliveryTermCode": "&5.&4.&3.&2.&1.&",
"shipToAddressType": "&5.&4.&3.&2.&1.&",
"shipToAddress": "&5.&4.&3.&2.&1.&",
"company": "&5.&4.&3.&2.&1.&",
"businessUnit": "&5.&4.&3.&2.&1.&",
"locationCode": "&5.&4.&3.&2.&1.&",
"deliverOn": "&5.&4.&3.&2.&1.&",
"paymentTermId": "&5.&4.&3.&2.&1.&",
"costingSplitLevel": "&5.&4.&3.&2.&1.&",
"costingSplitType": "&5.&4.&3.&2.&1.&",
"supplierAddress": "&5.&4.&3.&2.&1.&",
"supplierAddressERPID": "&5.&4.&3.&2.&1.&",
"supplierCurrencyCode": "&5.&4.&3.&2.&1.&",
"supplierERPID": "&5.&4.&3.&2.&1.&",
"suppPOContactEmail": "&5.&4.&3.&2.&1.&",
"supplierPOContactType": "&5.&4.&3.&2.&1.&"
},
"items": {
"item": {
"lineNumber": "&6.&5.&4.&3.&2.&1.&",
"requesterDetails": "&6.&5.&4.&3.&2.&1.&",
"categoryCode": "&6.&5.&4.&3.&2.&1.&",
"currency": "&6.&5.&4.&3.&2.&1.&",
"deliverToUser": {
"userEmailId": "&7.&6.&5.&4.&3.&2.&1.&"
},
"deliveryOn": "&6.&5.&4.&3.&2.&1.&",
"itemTotalAmount": "&6.&5.&4.&3.&2.&1.&",
"itemType": "&6.&5.&4.&3.&2.&1.&",
"manufacturerPartID": "&6.&5.&4.&3.&2.&1.&",
"marketPrice": "&6.&5.&4.&3.&2.&1.&",
"itemQuantity": "&6.&5.&4.&3.&2.&1.&",
"shipToAddressCode": "&6.&5.&4.&3.&2.&1.&",
"shipToAddressType": "&6.&5.&4.&3.&2.&1.&",
"costingSplitType": "&6.&5.&4.&3.&2.&1.&",
"supplierPartID": "&6.&5.&4.&3.&2.&1.&",
"validCombinations": {
"itemDetails": {
"#(2,distributedAmount)": "&8.&7.&6.&5.&4.&3.&2.&1.distributedAmount",
"validRules": {
"field": {
"*": {
"id": "&11.&10.&9.&8.&7.&6.&5.&4.&3.&2.[&1].&",
"type": "&11.&10.&9.&8.&7.&6.&5.&4.&3.&2.[&1].&",
"name": "&11.&10.&9.&8.&7.&6.&5.&4.&3.&2.[&1].&",
"value": "&11.&10.&9.&8.&7.&6.&5.&4.&3.&2.[&1].&"
}
}
}
}
}
}
}
}
}
}
}
}
},
{
"operation": "cardinality",
"spec": {
"*": {
"*": {
"*": {
"*": {
"status": "ONE",
"poHeader": {
"*": "ONE",
"checkoutBuyer": {
"userEmailId": "ONE"
},
"company": {
"*": "ONE"
}
},
"items": {
"item": {
"costingSplitType": "ONE",
"validCombinations": {
"itemDetails": {
"validRules": {
"field": {
"id": "ONE",
"type": "ONE",
"name": "ONE",
"value": "ONE"
}
}
}
}
}
}
}
}
}
}
}
},
{
"operation": "shift",
"spec": {
"*": {
"*": "&1.&[]"
}
}
}
]
You can replace the last shift transformation with the following one to the end which contains a # wildcard at the right-hand-side such as
{
"operation": "shift",
"spec": {
"*": {
"*": {
"*": "integrationDetails.&2.&1[#2].&"
}
}
}
}
I want to know how to rearrange values in JOLT. I want poDesciption field before poType.
I tried the below but didn't worked.-
"poDescription": "&5.&4.&3.&2.&1.&",
"poType": "&5.&4.&3.&2.&1.&",
Any idea on what changes I need to make to get poDesciption before poType and grossTotalAmount?
Order that I want-
Order that I am getting-
Below is the Input data-
{
"PURCHASE_ORDER_DISPATCH": {
"MsgData": {
"Transaction": {
"PO_POD_HDR_EVW1": {
"WG_ADDR_SEQ_NUM": 1,
"WG_PO_CNTCT_EMAIL": "PeggyMeincke#westfieldgrp.com",
"WG_REQUESTOR_EMAIL": "ZacharyEngels#westfieldgrp.com",
"WG_REQ_FIRST_NAME": "Zachary",
"WG_REQ_LAST_NAME": "Engels",
"WG_DELIVER_TO": "ZacharyEngels#westfieldgrp.com",
"BUSINESS_UNIT": "OFIC",
"PO_ID": 25052,
"VENDOR_SETID": "WCOS",
"VENDOR_ID": 35958,
"VNDR_LOC": 1,
"PO_DT": "2020-01-24",
"DB_NUMBER_BU": "",
"DESCR_BU": "OhioFarmersInsuranceCo",
"ADDRESS1_BU": "WESTFIELDCOMPANIES",
"ADDRESS2_BU": "HOMEOFFICE",
"ADDRESS3_BU": "1PARKCIRCLE",
"ADDRESS4_BU": "",
"CITY_BU": "WESTFIELDCENTER",
"STATE_BU": "OH",
"POSTAL_BU": "44251-5001",
"COUNTRY_BU": "USA",
"ADDRESS1_BILL": "",
"ADDRESS2_BILL": "",
"ADDRESS3_BILL": "",
"ADDRESS4_BILL": "",
"CITY_BILL": "",
"STATE_BILL": "",
"POSTAL_BILL": "",
"COUNTRY_BILL": "",
"CURRENCY_CD": "USD",
"TAX_EXEMPT_ID": "",
"STD_ID_NUM_VNDR": "",
"NAME1_VNDR": "AMAZONCAPITALSERVICESINC",
"ADDRESS1_VNDR": "410TERRYAVEN",
"ADDRESS2_VNDR": "",
"ADDRESS3_VNDR": "",
"ADDRESS4_VNDR": "",
"CITY_VNDR": "SEATTLE",
"STATE_VNDR": "WA",
"POSTAL_VNDR": 98109,
"COUNTRY_VNDR": "USA",
"PYMNT_TERMS_CD": "NET30",
"DESCR50_PAY": "Net30",
"BUYER_ID": 1083,
"PO_AMT_TTL": 14.99,
"TEXT254_CC1": "",
"TEXT254_CC2": "",
"VNDR_UPN_FLG": "N",
"STD_ID_NUM_VNDRGLN": "",
"STD_ID_NUM_BILLTO": "",
"ATTN_TO": "ZacharyEngels",
"PO_POD_LN_EVW1": {
"WG_REQ_ID": 25694,
"WG_CATEGORY_CD": "FSSUP",
"WG_ITEM_TYPE": 0,
"WG_ACCOUNT": 641100,
"WG_DEPT_ID": 30400,
"WG_PRODUCT": "",
"BUSINESS_UNIT": "OFIC",
"PO_ID": 25052,
"WG_ASSET_GROUP": "",
"WG_CAPITALIZE": "NO",
"WG_PROFILE_ID": "",
"WG_SPLIT_TYPE": 1,
"WG_ASSET_LOC": "HOME",
"WG_PROJECT": "",
"VENDOR_SETID": "WCOS",
"VENDOR_ID": 35958,
"VNDR_LOC": 1,
"LINE_NBR": 1,
"INV_ITEM_ID": "",
"DESCR254_MIXED": "147-1518156-3620845,1GreenMountainCoffeeRoastersCaramelVanillaCreamKeurigSingle-ServeK-CupPods,LightRoastCoffee,32Count",
"UNIT_OF_MEASURE": "EA",
"ITM_ID_VNDR": "B0798CX2Q9",
"INV_ITEM_WEIGHT": 0,
"INV_ITEM_HEIGHT": 0,
"INV_ITEM_VOLUME": 0,
"INV_ITEM_LENGTH": 0,
"INV_ITEM_WIDTH": 0,
"VNDR_CATALOG_ID": "",
"MFG_ID": "",
"MFG_ITM_ID": 5000196305,
"CNTRCT_ID": "",
"VERSION_NBR": 0,
"CNTRCT_LINE_NBR": 0,
"CAT_LINE_NBR": 0,
"RELEASE_NBR": 0,
"CANCEL_STATUS": "A",
"UPN_ID": "",
"PO_POD_SHP_EVW1": {
"WG_SHIP_ADDR_TYPE": 0,
"WG_CUST_ADDR_CODE": "OFIC",
"BUSINESS_UNIT": "OFIC",
"PO_ID": 25052,
"VENDOR_SETID": "WCOS",
"VENDOR_ID": 35958,
"VNDR_LOC": 1,
"LINE_NBR": 1,
"SCHED_NBR": 1,
"DUE_DT": "2020-01-29",
"SHIPTO_ID": "OFIC",
"DESCR_SHIPTO": "OHIOFARMERSINSURANCECOMPANY",
"ADDRESS1_SHIPTO": "OHIOFARMERSINSURANCECOMPANY",
"ADDRESS2_SHIPTO": "1PARKCIRCLE",
"ADDRESS3_SHIPTO": "POBOX5001",
"ADDRESS4_SHIPTO": "",
"CITY_SHIPTO": "WESTFIELDCENTER",
"STATE_SHIPTO": "OH",
"POSTAL_SHIPTO": "44251-5001",
"COUNTRY_SHIPTO": "USA",
"PRICE_PO": 14.99,
"FREIGHT_TERMS": "FOBDEST",
"QTY_PO": 1,
"SHIP_TYPE_ID": "BEST_WAY",
"CANCEL_STATUS": "A",
"ATTN_TO": "",
"STD_ID_NUM_SHIPTO": ""
},
"PSCAMA": {
"AUDIT_ACTN": "A"
}
},
"PSCAMA": {
"AUDIT_ACTN": "A"
}
},
"PSCAMA": {
"LANGUAGE_CD": "ENG",
"AUDIT_ACTN": "A",
"BASE_LANGUAGE_CD": "ENG",
"MSG_SEQ_FLG": "",
"PROCESS_INSTANCE": 1199010,
"PUBLISH_RULE_ID": "WG_MAIN_RULE",
"MSGNODENAME": ""
}
}
}
}
}
Below is the JOLT Spec-
[
{
"operation": "shift",
"spec": {
"#UPSERT": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityHeader.action",
"*": {
"*": {
"*": {
"*": {
"PO_ID": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.externalId",
"#APPROVED": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.status",
"PO_AMT_TTL": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.grossTotalAmount",
"FREIGHT_TERMS": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.deliveryTermCode",
"WG_REQUESTOR_EMAIL": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.requesterDetails.userEmailId",
"*": {
"WG_REQ_ID": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.poDescription",
"#STANDARD": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.poType",
"*": {
"FREIGHT_TERMS": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.deliveryTermCode"
}
}
}
}
}
}
}
},
{
"operation": "shift",
"spec": {
"*": {
"*": {
"*": {
"integrationEntityHeader": "&3.&2.&1.&",
"integrationEntityDetails": {
"*": {
"externalId": "&5.&4.&3.&2.&1.&",
"status": "&5.&4.&3.&2.&1.&",
"poHeader": "&5.&4.&3.&2.&1.&",
"poDescription": "&5.&4.&3.&2.&1.&",
"poType": "&5.&4.&3.&2.&1.&",
"items": "&5.&4.&3.&2.&1.&"
}
}
}
}
}
}
},
{
"operation": "cardinality",
"spec": {
"*": {
"*": {
"*": {
"*": {
"*": {
"status": "ONE",
"poHeader": {
"*": "ONE"
}
}
}
}
}
}
}
}
]
You can use this spec:
[
{
"operation": "shift",
"spec": {
"#UPSERT": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityHeader.action",
"*": {
"*": {
"*": {
"*": {
"PO_ID": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.externalId",
"#APPROVED": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.status",
"PO_AMT_TTL": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.grossTotalAmount",
"FREIGHT_TERMS": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.deliveryTermCode",
"WG_REQUESTOR_EMAIL": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.requesterDetails.userEmailId",
"*": {
"WG_REQ_ID": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.poDescription",
"#STANDARD": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.poType",
"*": {
"FREIGHT_TERMS": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.deliveryTermCode"
}
}
}
}
}
}
}
},
{
"operation": "shift",
"spec": {
"*": {
"*": {
"*": {
"integrationEntityHeader": "&3.&2.&1.&",
"integrationEntityDetails": {
"*": {
"externalId": "&5.&4.&3.&2.&1.&",
"status": "&5.&4.&3.&2.&1.&",
"poHeader": {
"poDescription": "&6.&5.&4.&3.&2.&1.&",
"poType": "&6.&5.&4.&3.&2.&1.&",
"grossTotalAmount": "&6.&5.&4.&3.&2.&1.&",
"deliveryTermCode": "&6.&5.&4.&3.&2.&1.&"
},
"items": "&5.&4.&3.&2.&1.&"
}
}
}
}
}
}
},
{
"operation": "cardinality",
"spec": {
"*": {
"*": {
"*": {
"*": {
"*": {
"status": "ONE",
"poHeader": {
"*": "ONE"
}
}
}
}
}
}
}
}
]
Indeed you don't need a cardinality spec, just order within the second shift spec through use of 0th index as follows
[
{
"operation": "shift",
"spec": {
"#UPSERT": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityHeader.action",
"*": {
"*": {
"*": {
"*": {
"PO_ID": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.externalId",
"#APPROVED": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.status",
"PO_AMT_TTL": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.grossTotalAmount",
"FREIGHT_TERMS": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.deliveryTermCode",
"WG_REQUESTOR_EMAIL": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.requesterDetails.userEmailId",
"*": {
"WG_REQ_ID": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.poDescription",
"#STANDARD": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.poType",
"*": {
"FREIGHT_TERMS": "integration-inbound:IntegrationDetails.integrationEntities.integrationEntity.integrationEntityDetails.poDetails.poHeader.deliveryTermCode"
}
}
}
}
}
}
}
},
{
"operation": "shift",
"spec": {
"*": {
"*": {
"*": {
"integrationEntityHeader": "&3.&2.&1.&",
"integrationEntityDetails": {
"*": {
"externalId": "&5.&4.&3.&2.&1.&",
"status": {
"0": "&6.&5.&4.&3.&2.&1"
},
//"status": "&5.&4.&3.&2.&1.&",
"poHeader": {
"poDescription": "&6.&5.&4.&3.&2.&1.&",
"poType": {
"0": "&7.&6.&5.&4.&3.&2.&1"
},
"grossTotalAmount": "&6.&5.&4.&3.&2.&1.&",
"deliveryTermCode": "&6.&5.&4.&3.&2.&1.&"
},
// "poDescription": "&5.&4.&3.&2.&1.&",
// "poType": "&5.&4.&3.&2.&1.&",
"items": "&5.&4.&3.&2.&1.&"
}
}
}
}
}
}
}
]
Btw, adding poDescription and poType attributes along with poHeader object has no sense as those are already contained within that object.