Home > Net >  Field not showing up in output in JOLT
Field not showing up in output in JOLT

Time:12-01

In JOLT I am trying multiplication operation for two fields "itemTotalAmount" and "distributedAmount". However itemTotalAmount is showing in the output but distributedAmount is not.

Main Snippet-

enter image description here

Any idea on what changes I need to make to in the JOLT spec to get the distributedAmount field in the output?

Input-

{
  "PURCHASE_ORDER_DISPATCH": {
    "MsgData": {
      "Transaction": {
        "PO_POD_HDR_EVW1": {
          "WG_ADDR_SEQ_NUM": 1,
          "WG_PO_CNTCT_EMAIL": "[email protected]",
          "WG_REQUESTOR_EMAIL": "[email protected]",
          "WG_REQ_FIRST_NAME": "Zachary",
          "WG_REQ_LAST_NAME": "Engels",
          "WG_DELIVER_TO": "[email protected]",
          "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": ""
        }
      }
    }
  }
}

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.poHeader.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": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddressCode",
                                    "@WG_SHIP_ADDR_TYPE": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddressType",
                                    "#1": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.costingSplitType",
                                    "@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"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    {
        "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": {
                                            "distributedAmount": "&8.&7.&6.&5.&4.&3.&2.&1.&",
                                            "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].&"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
]

CodePudding user response:

You can use this spec:

Just change this line "distributedAmount": "&8.&7.&6.&5.&4.&3.&2.&1.&", with "@(2,distributedAmount)": "&8.&7.&6.&5.&4.&3.&2.&1.distributedAmount",

[
  {
    "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.poHeader.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": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddressCode",
                  "@WG_SHIP_ADDR_TYPE": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.shipToAddressType",
                  "#1": "IntegrationEntities.integrationEntity.integrationEntityDetails.poDetails.items.item.costingSplitType",
                  "@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"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    },
  {
    "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].&"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    }
]
  • Related