Support Questions

Find answers, ask questions, and share your expertise

Jolt Returns unnecessary output

avatar
Explorer

This is my input JSON,

[
{
"CustomFields": [
{
"PrimaryId": 598870,
"ColumnName": "TRX_ORDER_CUSTOMFIELD2",
"FieldName": "PaymentMode",
"DataType": "nvarchar",
"Value": "Cash",
"HideFromExternalDistributor": 0,
"IsRequired": 1,
"ViewName": "PaymentMode",
"Type": "dropdown",
"Id": 118
},
{
"PrimaryId": 598870,
"ColumnName": "TRX_ORDER_CUSTOMFIELD3",
"FieldName": "test",
"DataType": "nvarchar",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "test",
"Type": "inputfield",
"Id": 119
},
{
"PrimaryId": 598870,
"ColumnName": "TRX_ORDER_CUSTOMFIELD4",
"FieldName": "Reason for Transfer",
"DataType": "nvarchar",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 1,
"ViewName": "ReasonforTransfer",
"Type": "dropdown",
"Id": 120
},
{
"PrimaryId": 598870,
"ColumnName": "TRX_ORDER_CUSTOMFIELD5",
"FieldName": "Remption Mode",
"DataType": "nvarchar",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 1,
"ViewName": "RemptionMode",
"Type": "dropdown",
"Id": 128
},
{
"PrimaryId": 598870,
"ColumnName": "TRX_ORDER_CUSTOMFIELD6",
"FieldName": "Redemption Bank",
"DataType": "nvarchar",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "RedemptionBank",
"Type": "inputfield",
"Id": 129
},
{
"PrimaryId": 598870,
"ColumnName": "TRX_ORDER_CUSTOMFIELD7",
"FieldName": "Redemption Account Name",
"DataType": "nvarchar",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "RedemptionAccountName",
"Type": "inputfield",
"Id": 130
},
{
"PrimaryId": 598870,
"ColumnName": "TRX_ORDER_CUSTOMFIELD8",
"FieldName": "Redemption Account Code",
"DataType": "nvarchar",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "RedemptionAccountCode",
"Type": "inputfield",
"Id": 131
},
{
"PrimaryId": 598870,
"ColumnName": "TRX_ORDER_CUSTOMFIELD9",
"FieldName": "Money Received Date",
"DataType": "datetime",
"Value": "May 7 2024 12:00AM",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "MoneyReceivedDate",
"Type": "inputfield",
"Id": 132
},
{
"PrimaryId": 598870,
"ColumnName": "TRX_ORDER_CUSTOMFIELD10",
"FieldName": "Currency Type",
"DataType": "nvarchar",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "CurrencyType",
"Type": "dropdown",
"Id": 152
},
{
"PrimaryId": 598870,
"ColumnName": "TRX_ORDER_CUSTOMFIELD11",
"FieldName": "Amount ",
"DataType": "nvarchar",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "Amount",
"Type": "inputfield",
"Id": 153
},
{
"PrimaryId": 598870,
"ColumnName": "TRX_ORDER_CUSTOMFIELD12",
"FieldName": "FX Rate",
"DataType": "nvarchar",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "FXRate",
"Type": "inputfield",
"Id": 154
},
{
"PrimaryId": 598870,
"ColumnName": "TRX_ORDER_CUSTOMFIELD13",
"FieldName": "Calculate Exit Fee",
"DataType": "nvarchar",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "CalculateExitFee",
"Type": "dropdown",
"Id": 177
},
{
"PrimaryId": 598870,
"ColumnName": "TRX_ORDER_CUSTOMFIELD14",
"FieldName": "Exit Fee",
"DataType": "money",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "ExitFee",
"Type": "inputfield",
"Id": 178
},
{
"PrimaryId": 598870,
"ColumnName": "TRX_ORDER_CUSTOMFIELD15",
"FieldName": "FOF Link",
"DataType": "int",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "FOFLink",
"Type": "inputfield",
"Id": 179
},
{
"PrimaryId": 598870,
"ColumnName": "TRX_ORDER_CUSTOMFIELD16",
"FieldName": "Cheque Number ",
"DataType": "nvarchar",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "ChequeNumber",
"Type": "inputfield",
"Id": 188
},
{
"PrimaryId": 598870,
"ColumnName": "TRX_ORDER_CUSTOMFIELD17",
"FieldName": "Locking Start Date",
"DataType": "datetime",
"Value": "",
"HideFromExternalDistributor": 1,
"IsRequired": 0,
"ViewName": "LockingStartDate",
"Type": "inputfield",
"Id": 236
},
{
"PrimaryId": 598870,
"ColumnName": "TRX_ORDER_CUSTOMFIELD18",
"FieldName": "Collection Account(from Investrack)",
"DataType": "nvarchar",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "CollectionAccount",
"Type": "inputfield",
"Id": 240
},
{
"PrimaryId": 598870,
"ColumnName": "TRX_ORDER_CUSTOMFIELD19",
"FieldName": "Order From Investrack",
"DataType": "nvarchar",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "OrderFromInvestrack",
"Type": "dropdown",
"Id": 241
},
{
"PrimaryId": 598870,
"ColumnName": "TRX_ORDER_CUSTOMFIELD20",
"FieldName": "APX Trade Date",
"DataType": "datetime",
"Value": "May 8 2024 12:00AM",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "ApxTradeDate",
"Type": "inputfield",
"Id": 250
},
{
"PrimaryId": 598870,
"ColumnName": "TRX_ORDER_CUSTOMFIELD21",
"FieldName": "Skip Document Check(Registered)",
"DataType": "nvarchar",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "Skipdocumentcheck",
"Type": "dropdown",
"Id": 251
},
{
"PrimaryId": 598870,
"ColumnName": "TRX_ORDER_CUSTOMFIELD22",
"FieldName": "IPCounter",
"DataType": "nvarchar",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "Ipcounter",
"Type": "inputfield",
"Id": 261
}
],
"CustomerId": 2161271,
"Id": 598870,
"Guid": "59d9640e-c00c-4ced-a761-8ab1641cbd37",
"Created": "2024-05-08T13:37:15.99",
"Amount": 1000,
"SwitchPercent": null,
"Quantity": 0,
"ItemPrice": null,
"Kid": null,
"PaymentDate": "2024-05-08T00:00:00",
"CustomerAccountId": null,
"CustomerAccountName": null,
"CustomerAccountNumber": null,
"TradeTypeId": 1,
"TradeTypeProgId": "BUY",
"TradeTypeName": "Buy",
"SwitchId": null,
"OrderStatusId": 16,
"OrderStatusProgId": "CCL",
"OrderStatusName": "Cancelled",
"CurrencyId": 222,
"CurrencyIso": "LKR",
"CurrencyName": "Rupee",
"PortfolioId": 2106841,
"PortfolioExternalId": null,
"PortfolioName": "1ShareAPILakmal1234567891ShareAPILakmal123456789",
"ProductId": 28315,
"ProductIsin": "LKNWINU00000",
"ProductName": "NDB WEALTH INCOME FUND",
"AgreementId": null,
"AgreementExternalId": null,
"AgreementName": null,
"FeeId": 2343,
"FeeName": "Fee 0.00%",
"FeeAmountOrPercent": "P",
"FeeValue": 0,
"FeeDisplayName": "NAME",
"CommissionId": null,
"CommissionName": null,
"CommissionAmountOrPercent": null,
"CommissionValue": null,
"PaymentTypeId": 79,
"PaymentTypeProgId": "GENERIC_IN",
"PaymentTypeName": "GENERIC Incoming for SIP",
"Comment": null,
"UserId": 6699,
"UserName": "ndbaviva\\yatheendra",
"MoxyOrderId": null,
"OrderModelId": 3,
"DistributorId": 141,
"ChannelId": 1,
"CommissionAmount": null,
"FeeAmount": 0,
"NetAmount": 1000,
"ExchangeFeeAmount": 0,
"ExchangeFeePercent": 0,
"ToExchangeAmount": 1000,
"FxPercent": 1,
"OrderFxPercent": 1,
"SupplierAmount": 1000,
"SupplierItemPrice": null,
"TradeDate": "2024-05-07T00:00:00",
"SettleDate": null,
"SupplierReference": null,
"GibAmount": 5,
"ExternalId": null,
"FeePercent": 0,
"GibPercent": 0.5,
"ExchangeAccountId": null,
"IncentiveDate": null,
"PaidDate": "2024-05-08T13:41:00",
"CancelledDate": "2024-06-06T09:11:40.027",
"StatusChangeDate": "2024-06-06T09:12:00",
"SavingsId": null,
"ModelOrderId": null,
"CashProductId": 28137,
"CashProductIsin": null,
"CashProductName": "Cash Account",
"SupplierFeeAmount": 0,
"SupplierFeePercent": 0,
"SupplierFeeId": 2343,
"SupplierNetFeeAmount": 1000,
"CustodyId": 0,
"CustodianId": 0,
"CashUpFront": 0,
"OrderMatchId": null,
"LotNumber": 0,
"InterestDays": null,
"BuySettleDays": null,
"SellSettleDays": null,
"OwnerId": 6699,
"OrderdetailTypeId": 909,
"OrderdetailDate": "2024-05-08T13:36:00",
"OrderdetailComment": null,
"PeriodicRedemptionId": null,
"CreatedByUserId": 6699,
"IsSettledInAmount": 1,
"CostPrice": null,
"NavDate": "2024-05-29T00:00:00",
"CostDate": null,
"CommittedCapital": null,
"ContributedCapital": null,
"Recallable": 0,
"PortfolioTypeId": 140,
"PortfolioTypeProgId": "UNIT TRUST",
"PortfolioTypeName": "APX TYPE",
"SellShort": 0,
"OrderHeaderId": null,
"PortfolioExternalNumericId": 77623,
"AxysPortfolioId": "1007919-09",
"RecordDate": null,
"RequiresApproval": "NO",
"Interest": null,
"AlternativeFee1": null,
"AlternativeFee2": null,
"ChannelProgId": "ORD",
"ChannelName": "Sales",
"OrderdetialTypeProgId": "FAX",
"OrderdetialTypeName": "Fax",
"OrderSourceId": null,
"OrderSourceValue": null,
"OrderSource": null,
"CustomerPersonalId": "1007919",
"DistributorProgId": "NDBWealth ",
"CreatedByUserName": "ndbaviva\\yatheendra",
"BulkOrder": 0,
"FlowCode": null,
"ReturnOfCapital": null,
"RecallableReturnOfCapital": null,
"PreferredReturn": null,
"RecallablePreferredReturn": null,
"ProfitAboveHurdle": null,
"RecallableProfitAboveHurdle": null,
"TaxDistributionAmount": null,
"IsTaxDistribution": 0
},
{
"CustomFields": [
{
"PrimaryId": 598869,
"ColumnName": "TRX_ORDER_CUSTOMFIELD2",
"FieldName": "PaymentMode",
"DataType": "nvarchar",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 1,
"ViewName": "PaymentMode",
"Type": "dropdown",
"Id": 118
},
{
"PrimaryId": 598869,
"ColumnName": "TRX_ORDER_CUSTOMFIELD3",
"FieldName": "test",
"DataType": "nvarchar",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "test",
"Type": "inputfield",
"Id": 119
},
{
"PrimaryId": 598869,
"ColumnName": "TRX_ORDER_CUSTOMFIELD4",
"FieldName": "Reason for Transfer",
"DataType": "nvarchar",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 1,
"ViewName": "ReasonforTransfer",
"Type": "dropdown",
"Id": 120
},
{
"PrimaryId": 598869,
"ColumnName": "TRX_ORDER_CUSTOMFIELD5",
"FieldName": "Remption Mode",
"DataType": "nvarchar",
"Value": "CEFT",
"HideFromExternalDistributor": 0,
"IsRequired": 1,
"ViewName": "RemptionMode",
"Type": "dropdown",
"Id": 128
},
{
"PrimaryId": 598869,
"ColumnName": "TRX_ORDER_CUSTOMFIELD6",
"FieldName": "Redemption Bank",
"DataType": "nvarchar",
"Value": "7311001",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "RedemptionBank",
"Type": "inputfield",
"Id": 129
},
{
"PrimaryId": 598869,
"ColumnName": "TRX_ORDER_CUSTOMFIELD7",
"FieldName": "Redemption Account Name",
"DataType": "nvarchar",
"Value": " C.Y.L. FONSEKAtest1",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "RedemptionAccountName",
"Type": "inputfield",
"Id": 130
},
{
"PrimaryId": 598869,
"ColumnName": "TRX_ORDER_CUSTOMFIELD8",
"FieldName": "Redemption Account Code",
"DataType": "nvarchar",
"Value": " 108562522565",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "RedemptionAccountCode",
"Type": "inputfield",
"Id": 131
},
{
"PrimaryId": 598869,
"ColumnName": "TRX_ORDER_CUSTOMFIELD9",
"FieldName": "Money Received Date",
"DataType": "datetime",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "MoneyReceivedDate",
"Type": "inputfield",
"Id": 132
},
{
"PrimaryId": 598869,
"ColumnName": "TRX_ORDER_CUSTOMFIELD10",
"FieldName": "Currency Type",
"DataType": "nvarchar",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "CurrencyType",
"Type": "dropdown",
"Id": 152
},
{
"PrimaryId": 598869,
"ColumnName": "TRX_ORDER_CUSTOMFIELD11",
"FieldName": "Amount ",
"DataType": "nvarchar",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "Amount",
"Type": "inputfield",
"Id": 153
},
{
"PrimaryId": 598869,
"ColumnName": "TRX_ORDER_CUSTOMFIELD12",
"FieldName": "FX Rate",
"DataType": "nvarchar",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "FXRate",
"Type": "inputfield",
"Id": 154
},
{
"PrimaryId": 598869,
"ColumnName": "TRX_ORDER_CUSTOMFIELD13",
"FieldName": "Calculate Exit Fee",
"DataType": "nvarchar",
"Value": "Yes",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "CalculateExitFee",
"Type": "dropdown",
"Id": 177
},
{
"PrimaryId": 598869,
"ColumnName": "TRX_ORDER_CUSTOMFIELD14",
"FieldName": "Exit Fee",
"DataType": "money",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "ExitFee",
"Type": "inputfield",
"Id": 178
},
{
"PrimaryId": 598869,
"ColumnName": "TRX_ORDER_CUSTOMFIELD15",
"FieldName": "FOF Link",
"DataType": "int",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "FOFLink",
"Type": "inputfield",
"Id": 179
},
{
"PrimaryId": 598869,
"ColumnName": "TRX_ORDER_CUSTOMFIELD16",
"FieldName": "Cheque Number ",
"DataType": "nvarchar",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "ChequeNumber",
"Type": "inputfield",
"Id": 188
},
{
"PrimaryId": 598869,
"ColumnName": "TRX_ORDER_CUSTOMFIELD17",
"FieldName": "Locking Start Date",
"DataType": "datetime",
"Value": "",
"HideFromExternalDistributor": 1,
"IsRequired": 0,
"ViewName": "LockingStartDate",
"Type": "inputfield",
"Id": 236
},
{
"PrimaryId": 598869,
"ColumnName": "TRX_ORDER_CUSTOMFIELD18",
"FieldName": "Collection Account(from Investrack)",
"DataType": "nvarchar",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "CollectionAccount",
"Type": "inputfield",
"Id": 240
},
{
"PrimaryId": 598869,
"ColumnName": "TRX_ORDER_CUSTOMFIELD19",
"FieldName": "Order From Investrack",
"DataType": "nvarchar",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "OrderFromInvestrack",
"Type": "dropdown",
"Id": 241
},
{
"PrimaryId": 598869,
"ColumnName": "TRX_ORDER_CUSTOMFIELD20",
"FieldName": "APX Trade Date",
"DataType": "datetime",
"Value": "May 8 2024 12:00AM",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "ApxTradeDate",
"Type": "inputfield",
"Id": 250
},
{
"PrimaryId": 598869,
"ColumnName": "TRX_ORDER_CUSTOMFIELD21",
"FieldName": "Skip Document Check(Registered)",
"DataType": "nvarchar",
"Value": "Yes",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "Skipdocumentcheck",
"Type": "dropdown",
"Id": 251
},
{
"PrimaryId": 598869,
"ColumnName": "TRX_ORDER_CUSTOMFIELD22",
"FieldName": "IPCounter",
"DataType": "nvarchar",
"Value": "",
"HideFromExternalDistributor": 0,
"IsRequired": 0,
"ViewName": "Ipcounter",
"Type": "inputfield",
"Id": 261
}
],
"CustomerId": 2161271,
"Id": 598869,
"Guid": "6e7c2597-30be-4aa1-9db5-0fa53716c60a",
"Created": "2024-05-08T13:04:48.007",
"Amount": 11120,
"SwitchPercent": null,
"Quantity": 0,
"ItemPrice": null,
"Kid": null,
"PaymentDate": "2024-05-08T13:04:00",
"CustomerAccountId": null,
"CustomerAccountName": null,
"CustomerAccountNumber": null,
"TradeTypeId": 2,
"TradeTypeProgId": "SELL",
"TradeTypeName": "Sell",
"SwitchId": null,
"OrderStatusId": 16,
"OrderStatusProgId": "CCL",
"OrderStatusName": "Cancelled",
"CurrencyId": 222,
"CurrencyIso": "LKR",
"CurrencyName": "Rupee",
"PortfolioId": 2076305,
"PortfolioExternalId": null,
"PortfolioName": "Y.L. FONSEKA (02)",
"ProductId": 28431,
"ProductIsin": "LKNWMNU00002",
"ProductName": "NDB WEALTH MONEY FUND",
"AgreementId": null,
"AgreementExternalId": null,
"AgreementName": null,
"FeeId": 2343,
"FeeName": "Fee 0.00%",
"FeeAmountOrPercent": "P",
"FeeValue": 0,
"FeeDisplayName": "NAME",
"CommissionId": null,
"CommissionName": null,
"CommissionAmountOrPercent": null,
"CommissionValue": null,
"PaymentTypeId": 81,
"PaymentTypeProgId": "GENERIC_OT",
"PaymentTypeName": "GENERIC Outgoing",
"Comment": "MIRunningNO",
"UserId": 22752,
"UserName": "acupdateU",
"MoxyOrderId": null,
"OrderModelId": 6,
"DistributorId": null,
"ChannelId": 18,
"CommissionAmount": null,
"FeeAmount": 0,
"NetAmount": 11120,
"ExchangeFeeAmount": 0,
"ExchangeFeePercent": 0,
"ToExchangeAmount": 11120,
"FxPercent": 1,
"OrderFxPercent": 1,
"SupplierAmount": 11120,
"SupplierItemPrice": null,
"TradeDate": "2024-05-07T00:00:00",
"SettleDate": null,
"SupplierReference": null,
"GibAmount": 0,
"ExternalId": null,
"FeePercent": 0,
"GibPercent": 0,
"ExchangeAccountId": null,
"IncentiveDate": null,
"PaidDate": null,
"CancelledDate": "2024-06-06T09:11:40.153",
"StatusChangeDate": "2024-06-06T09:12:00",
"SavingsId": null,
"ModelOrderId": null,
"CashProductId": 28137,
"CashProductIsin": null,
"CashProductName": "Cash Account",
"SupplierFeeAmount": 0,
"SupplierFeePercent": 0,
"SupplierFeeId": 2343,
"SupplierNetFeeAmount": 11120,
"CustodyId": 0,
"CustodianId": 0,
"CashUpFront": 0,
"OrderMatchId": null,
"LotNumber": -1,
"InterestDays": null,
"BuySettleDays": null,
"SellSettleDays": null,
"OwnerId": 22752,
"OrderdetailTypeId": null,
"OrderdetailDate": null,
"OrderdetailComment": null,
"PeriodicRedemptionId": null,
"CreatedByUserId": 22752,
"IsSettledInAmount": 1,
"CostPrice": null,
"NavDate": null,
"CostDate": null,
"CommittedCapital": null,
"ContributedCapital": null,
"Recallable": 0,
"PortfolioTypeId": 140,
"PortfolioTypeProgId": "UNIT TRUST",
"PortfolioTypeName": "APX TYPE",
"SellShort": 0,
"OrderHeaderId": null,
"PortfolioExternalNumericId": 16438,
"AxysPortfolioId": "1007919-02",
"RecordDate": null,
"RequiresApproval": "NO",
"Interest": null,
"AlternativeFee1": null,
"AlternativeFee2": null,
"ChannelProgId": "CUSTOM17",
"ChannelName": "API use only",
"OrderdetialTypeProgId": null,
"OrderdetialTypeName": null,
"OrderSourceId": null,
"OrderSourceValue": null,
"OrderSource": null,
"CustomerPersonalId": "1007919",
"DistributorProgId": null,
"CreatedByUserName": "acupdateU",
"BulkOrder": 0,
"FlowCode": null,
"ReturnOfCapital": null,
"RecallableReturnOfCapital": null,
"PreferredReturn": null,
"RecallablePreferredReturn": null,
"ProfitAboveHurdle": null,
"RecallableProfitAboveHurdle": null,
"TaxDistributionAmount": null,
"IsTaxDistribution": 0
}
]

==============================================

Here is my JOLT spec,

[
{
"operation": "shift",
"spec": {
"*": {
"CustomFields": {
"*": {
"@(0,Value)": "[&3].@(0,ViewName)"
}
},
"PortfolioSharing": {
"*": {
"@(0,PortfolioId)": "[&3].sharing_PortfolioId",
"@(0,CustomerId)": "[&3].sharing_CustomerId",
"@(0,PersonalId)": "[&3].sharing_PersonalId",
"@(0,ReasonId)": "[&3].sharing_ReasonId",
"@(0,ReasonProgId)": "[&3].sharing_ReasonProgId",
"@(0,ReasonName)": "[&3].sharing_ReasonName",
"@(0,Comment)": "[&3].sharing_Comment",
"@(0,TypeId)": "[&3].sharing_TypeId",
"@(0,TypeProgId)": "[&3].sharing_TypeProgId",
"@(0,TypeName)": "[&3].sharing_TypeName"
}
},
"*": "[&1].&"
}
}
},
{
"operation": "modify-default-beta",
"spec": {
"*": {
// trx_customer
"ResidentNonresident": "@(1,Resident/Non-resident)",
"NationalityCountryofIncorporation": "@(1,Nationality/CountryofIncorporation)",
"PermanantTownCity": "@(1,PermanantTown/City)",
"SubsidiaryAssociateofanotherorganization": "@(1,Subsidiary/Associateofanotherorganization)",
"Howdidyougettoknowaboutus": "@(1,Howdidyougettoknowaboutus?)",
// trx_portfolio
"UseBankAccountFromCustomer": "@(1,UseBankAccountFromCustomer?)"
}
}
},
{
"operation": "remove",
"spec": {
"*": {
// trx_customer
"Resident/Non-resident": "",
"Nationality/CountryofIncorporation": "",
"PermanantTown/City": "",
"Subsidiary/Associateofanotherorganization": "",
"NatureOf_Business": "",
"Howdidyougettoknowaboutus?": "",
//trx_portfolio
"UseBankAccountFromCustomer?": ""
}
}
}
]
==================================
After the execute JOLT, result like that,


[ {
"PaymentMode" : "Cash",
"test" : "",
"ReasonforTransfer" : "",
"RemptionMode" : "",
"RedemptionBank" : "",
"RedemptionAccountName" : "",
"RedemptionAccountCode" : "",
"MoneyReceivedDate" : "May 7 2024 12:00AM",
"CurrencyType" : "",
"Amount" : [ "", 1000 ],
"FXRate" : "",
"CalculateExitFee" : "",
"ExitFee" : "",
"FOFLink" : "",
"ChequeNumber" : "",
"LockingStartDate" : "",
"CollectionAccount" : "",
"OrderFromInvestrack" : "",
"ApxTradeDate" : "May 8 2024 12:00AM",
"Skipdocumentcheck" : "",
"Ipcounter" : "",
"CustomerId" : 2161271,
"Id" : 598870,
"Guid" : "59d9640e-c00c-4ced-a761-8ab1641cbd37",
"Created" : "2024-05-08T13:37:15.99",
"SwitchPercent" : null,
"Quantity" : 0,
"ItemPrice" : null,
"Kid" : null,
"PaymentDate" : "2024-05-08T00:00:00",
"CustomerAccountId" : null,
"CustomerAccountName" : null,
"CustomerAccountNumber" : null,
"TradeTypeId" : 1,
"TradeTypeProgId" : "BUY",
"TradeTypeName" : "Buy",
"SwitchId" : null,
"OrderStatusId" : 16,
"OrderStatusProgId" : "CCL",
"OrderStatusName" : "Cancelled",
"CurrencyId" : 222,
"CurrencyIso" : "LKR",
"CurrencyName" : "Rupee",
"PortfolioId" : 2106841,
"PortfolioExternalId" : null,
"PortfolioName" : "1ShareAPILakmal1234567891ShareAPILakmal123456789",
"ProductId" : 28315,
"ProductIsin" : "LKNWINU00000",
"ProductName" : "NDB WEALTH INCOME FUND",
"AgreementId" : null,
"AgreementExternalId" : null,
"AgreementName" : null,
"FeeId" : 2343,
"FeeName" : "Fee 0.00%",
"FeeAmountOrPercent" : "P",
"FeeValue" : 0,
"FeeDisplayName" : "NAME",
"CommissionId" : null,
"CommissionName" : null,
"CommissionAmountOrPercent" : null,
"CommissionValue" : null,
"PaymentTypeId" : 79,
"PaymentTypeProgId" : "GENERIC_IN",
"PaymentTypeName" : "GENERIC Incoming for SIP",
"Comment" : null,
"UserId" : 6699,
"UserName" : "ndbaviva\\yatheendra",
"MoxyOrderId" : null,
"OrderModelId" : 3,
"DistributorId" : 141,
"ChannelId" : 1,
"CommissionAmount" : null,
"FeeAmount" : 0,
"NetAmount" : 1000,
"ExchangeFeeAmount" : 0,
"ExchangeFeePercent" : 0,
"ToExchangeAmount" : 1000,
"FxPercent" : 1,
"OrderFxPercent" : 1,
"SupplierAmount" : 1000,
"SupplierItemPrice" : null,
"TradeDate" : "2024-05-07T00:00:00",
"SettleDate" : null,
"SupplierReference" : null,
"GibAmount" : 5,
"ExternalId" : null,
"FeePercent" : 0,
"GibPercent" : 0.5,
"ExchangeAccountId" : null,
"IncentiveDate" : null,
"PaidDate" : "2024-05-08T13:41:00",
"CancelledDate" : "2024-06-06T09:11:40.027",
"StatusChangeDate" : "2024-06-06T09:12:00",
"SavingsId" : null,
"ModelOrderId" : null,
"CashProductId" : 28137,
"CashProductIsin" : null,
"CashProductName" : "Cash Account",
"SupplierFeeAmount" : 0,
"SupplierFeePercent" : 0,
"SupplierFeeId" : 2343,
"SupplierNetFeeAmount" : 1000,
"CustodyId" : 0,
"CustodianId" : 0,
"CashUpFront" : 0,
"OrderMatchId" : null,
"LotNumber" : 0,
"InterestDays" : null,
"BuySettleDays" : null,
"SellSettleDays" : null,
"OwnerId" : 6699,
"OrderdetailTypeId" : 909,
"OrderdetailDate" : "2024-05-08T13:36:00",
"OrderdetailComment" : null,
"PeriodicRedemptionId" : null,
"CreatedByUserId" : 6699,
"IsSettledInAmount" : 1,
"CostPrice" : null,
"NavDate" : "2024-05-29T00:00:00",
"CostDate" : null,
"CommittedCapital" : null,
"ContributedCapital" : null,
"Recallable" : 0,
"PortfolioTypeId" : 140,
"PortfolioTypeProgId" : "UNIT TRUST",
"PortfolioTypeName" : "APX TYPE",
"SellShort" : 0,
"OrderHeaderId" : null,
"PortfolioExternalNumericId" : 77623,
"AxysPortfolioId" : "1007919-09",
"RecordDate" : null,
"RequiresApproval" : "NO",
"Interest" : null,
"AlternativeFee1" : null,
"AlternativeFee2" : null,
"ChannelProgId" : "ORD",
"ChannelName" : "Sales",
"OrderdetialTypeProgId" : "FAX",
"OrderdetialTypeName" : "Fax",
"OrderSourceId" : null,
"OrderSourceValue" : null,
"OrderSource" : null,
"CustomerPersonalId" : "1007919",
"DistributorProgId" : "NDBWealth ",
"CreatedByUserName" : "ndbaviva\\yatheendra",
"BulkOrder" : 0,
"FlowCode" : null,
"ReturnOfCapital" : null,
"RecallableReturnOfCapital" : null,
"PreferredReturn" : null,
"RecallablePreferredReturn" : null,
"ProfitAboveHurdle" : null,
"RecallableProfitAboveHurdle" : null,
"TaxDistributionAmount" : null,
"IsTaxDistribution" : 0
}, {
"PaymentMode" : "",
"test" : "",
"ReasonforTransfer" : "",
"RemptionMode" : "CEFT",
"RedemptionBank" : "7311001",
"RedemptionAccountName" : " C.Y.L. FONSEKAtest1",
"RedemptionAccountCode" : " 108562522565",
"MoneyReceivedDate" : "",
"CurrencyType" : "",
"Amount" : [ "", 11120 ],
"FXRate" : "",
"CalculateExitFee" : "Yes",
"ExitFee" : "",
"FOFLink" : "",
"ChequeNumber" : "",
"LockingStartDate" : "",
"CollectionAccount" : "",
"OrderFromInvestrack" : "",
"ApxTradeDate" : "May 8 2024 12:00AM",
"Skipdocumentcheck" : "Yes",
"Ipcounter" : "",
"CustomerId" : 2161271,
"Id" : 598869,
"Guid" : "6e7c2597-30be-4aa1-9db5-0fa53716c60a",
"Created" : "2024-05-08T13:04:48.007",
"SwitchPercent" : null,
"Quantity" : 0,
"ItemPrice" : null,
"Kid" : null,
"PaymentDate" : "2024-05-08T13:04:00",
"CustomerAccountId" : null,
"CustomerAccountName" : null,
"CustomerAccountNumber" : null,
"TradeTypeId" : 2,
"TradeTypeProgId" : "SELL",
"TradeTypeName" : "Sell",
"SwitchId" : null,
"OrderStatusId" : 16,
"OrderStatusProgId" : "CCL",
"OrderStatusName" : "Cancelled",
"CurrencyId" : 222,
"CurrencyIso" : "LKR",
"CurrencyName" : "Rupee",
"PortfolioId" : 2076305,
"PortfolioExternalId" : null,
"PortfolioName" : "Y.L. FONSEKA (02)",
"ProductId" : 28431,
"ProductIsin" : "LKNWMNU00002",
"ProductName" : "NDB WEALTH MONEY FUND",
"AgreementId" : null,
"AgreementExternalId" : null,
"AgreementName" : null,
"FeeId" : 2343,
"FeeName" : "Fee 0.00%",
"FeeAmountOrPercent" : "P",
"FeeValue" : 0,
"FeeDisplayName" : "NAME",
"CommissionId" : null,
"CommissionName" : null,
"CommissionAmountOrPercent" : null,
"CommissionValue" : null,
"PaymentTypeId" : 81,
"PaymentTypeProgId" : "GENERIC_OT",
"PaymentTypeName" : "GENERIC Outgoing",
"Comment" : "MIRunningNO",
"UserId" : 22752,
"UserName" : "acupdateU",
"MoxyOrderId" : null,
"OrderModelId" : 6,
"DistributorId" : null,
"ChannelId" : 18,
"CommissionAmount" : null,
"FeeAmount" : 0,
"NetAmount" : 11120,
"ExchangeFeeAmount" : 0,
"ExchangeFeePercent" : 0,
"ToExchangeAmount" : 11120,
"FxPercent" : 1,
"OrderFxPercent" : 1,
"SupplierAmount" : 11120,
"SupplierItemPrice" : null,
"TradeDate" : "2024-05-07T00:00:00",
"SettleDate" : null,
"SupplierReference" : null,
"GibAmount" : 0,
"ExternalId" : null,
"FeePercent" : 0,
"GibPercent" : 0,
"ExchangeAccountId" : null,
"IncentiveDate" : null,
"PaidDate" : null,
"CancelledDate" : "2024-06-06T09:11:40.153",
"StatusChangeDate" : "2024-06-06T09:12:00",
"SavingsId" : null,
"ModelOrderId" : null,
"CashProductId" : 28137,
"CashProductIsin" : null,
"CashProductName" : "Cash Account",
"SupplierFeeAmount" : 0,
"SupplierFeePercent" : 0,
"SupplierFeeId" : 2343,
"SupplierNetFeeAmount" : 11120,
"CustodyId" : 0,
"CustodianId" : 0,
"CashUpFront" : 0,
"OrderMatchId" : null,
"LotNumber" : -1,
"InterestDays" : null,
"BuySettleDays" : null,
"SellSettleDays" : null,
"OwnerId" : 22752,
"OrderdetailTypeId" : null,
"OrderdetailDate" : null,
"OrderdetailComment" : null,
"PeriodicRedemptionId" : null,
"CreatedByUserId" : 22752,
"IsSettledInAmount" : 1,
"CostPrice" : null,
"NavDate" : null,
"CostDate" : null,
"CommittedCapital" : null,
"ContributedCapital" : null,
"Recallable" : 0,
"PortfolioTypeId" : 140,
"PortfolioTypeProgId" : "UNIT TRUST",
"PortfolioTypeName" : "APX TYPE",
"SellShort" : 0,
"OrderHeaderId" : null,
"PortfolioExternalNumericId" : 16438,
"AxysPortfolioId" : "1007919-02",
"RecordDate" : null,
"RequiresApproval" : "NO",
"Interest" : null,
"AlternativeFee1" : null,
"AlternativeFee2" : null,
"ChannelProgId" : "CUSTOM17",
"ChannelName" : "API use only",
"OrderdetialTypeProgId" : null,
"OrderdetialTypeName" : null,
"OrderSourceId" : null,
"OrderSourceValue" : null,
"OrderSource" : null,
"CustomerPersonalId" : "1007919",
"DistributorProgId" : null,
"CreatedByUserName" : "acupdateU",
"BulkOrder" : 0,
"FlowCode" : null,
"ReturnOfCapital" : null,
"RecallableReturnOfCapital" : null,
"PreferredReturn" : null,
"RecallablePreferredReturn" : null,
"ProfitAboveHurdle" : null,
"RecallableProfitAboveHurdle" : null,
"TaxDistributionAmount" : null,
"IsTaxDistribution" : 0
} ]

===============================

The problem is here,
"Amount" : [ "", 1000 ]"

There are two "Amount" fields in my input json, First one is in the "CustomFiled" and the other one is in the main root json,

I need to get these two "Amount" fields separately, 
as an example,
"Amount1" and "Amount2",
To do this, How do I change my JOLT spec.?

Thanks for advance.
1 ACCEPTED SOLUTION

avatar
Super Guru

Hi ,

Just a word of advice so you get better luck with your posts getting noticed and possibly someone to provide you with possible resolution: If you can shorten your  json input next time to be isolated only to the problem that would be more helpful.  You dont have to post the 99% that works with the 1% that doesnt as long as it doesnt affect the overall structure. For example if you have 50 fields you can just post 1-2 fields and  if you have an array of 50 elements , 1-2 elements should be enough.

Going to your problem , if you know that you will only have two amounts all the times as you specified, then you can intercept them in the first shift spec and assign the proper field names (Amount1, Amount2 ) as follows:

 

 

[
  {
    "operation": "shift",
    "spec": {
      "*": {
        "CustomFields": {
          "*": {
            "ViewName": {
              "Amount": {
                "@(2,Value)": "[&5].Amount1"
              },
              "*": {
                "@(2,Value)": "[&5].&1"
              }
            }
          }
        },
        "PortfolioSharing": {
          "*": {
            "@(0,PortfolioId)": "[&3].sharing_PortfolioId",
            "@(0,CustomerId)": "[&3].sharing_CustomerId",
            "@(0,PersonalId)": "[&3].sharing_PersonalId",
            "@(0,ReasonId)": "[&3].sharing_ReasonId",
            "@(0,ReasonProgId)": "[&3].sharing_ReasonProgId",
            "@(0,ReasonName)": "[&3].sharing_ReasonName",
            "@(0,Comment)": "[&3].sharing_Comment",
            "@(0,TypeId)": "[&3].sharing_TypeId",
            "@(0,TypeProgId)": "[&3].sharing_TypeProgId",
            "@(0,TypeName)": "[&3].sharing_TypeName"
          }
        },
        "Amount": "[&1].Amount2",
        "*": "[&1].&"
      }
    }
}
  ,
  {
    "operation": "modify-default-beta",
    "spec": {
      "*": {
        // trx_customer
        "ResidentNonresident": "@(1,Resident/Non-resident)",
        "NationalityCountryofIncorporation": "@(1,Nationality/CountryofIncorporation)",
        "PermanantTownCity": "@(1,PermanantTown/City)",
        "SubsidiaryAssociateofanotherorganization": "@(1,Subsidiary/Associateofanotherorganization)",
        "Howdidyougettoknowaboutus": "@(1,Howdidyougettoknowaboutus?)",
        // trx_portfolio
        "UseBankAccountFromCustomer": "@(1,UseBankAccountFromCustomer?)"
      }
    }
},
  {
    "operation": "remove",
    "spec": {
      "*": {
        // trx_customer
        "Resident/Non-resident": "",
        "Nationality/CountryofIncorporation": "",
        "PermanantTown/City": "",
        "Subsidiary/Associateofanotherorganization": "",
        "NatureOf_Business": "",
        "Howdidyougettoknowaboutus?": "",
        //trx_portfolio
        "UseBankAccountFromCustomer?": ""
      }
    }
} /**/
]

Hope that solve your problem.

If you found this is helpful, please accept the solution.

Thanks

 

 

View solution in original post

1 REPLY 1

avatar
Super Guru

Hi ,

Just a word of advice so you get better luck with your posts getting noticed and possibly someone to provide you with possible resolution: If you can shorten your  json input next time to be isolated only to the problem that would be more helpful.  You dont have to post the 99% that works with the 1% that doesnt as long as it doesnt affect the overall structure. For example if you have 50 fields you can just post 1-2 fields and  if you have an array of 50 elements , 1-2 elements should be enough.

Going to your problem , if you know that you will only have two amounts all the times as you specified, then you can intercept them in the first shift spec and assign the proper field names (Amount1, Amount2 ) as follows:

 

 

[
  {
    "operation": "shift",
    "spec": {
      "*": {
        "CustomFields": {
          "*": {
            "ViewName": {
              "Amount": {
                "@(2,Value)": "[&5].Amount1"
              },
              "*": {
                "@(2,Value)": "[&5].&1"
              }
            }
          }
        },
        "PortfolioSharing": {
          "*": {
            "@(0,PortfolioId)": "[&3].sharing_PortfolioId",
            "@(0,CustomerId)": "[&3].sharing_CustomerId",
            "@(0,PersonalId)": "[&3].sharing_PersonalId",
            "@(0,ReasonId)": "[&3].sharing_ReasonId",
            "@(0,ReasonProgId)": "[&3].sharing_ReasonProgId",
            "@(0,ReasonName)": "[&3].sharing_ReasonName",
            "@(0,Comment)": "[&3].sharing_Comment",
            "@(0,TypeId)": "[&3].sharing_TypeId",
            "@(0,TypeProgId)": "[&3].sharing_TypeProgId",
            "@(0,TypeName)": "[&3].sharing_TypeName"
          }
        },
        "Amount": "[&1].Amount2",
        "*": "[&1].&"
      }
    }
}
  ,
  {
    "operation": "modify-default-beta",
    "spec": {
      "*": {
        // trx_customer
        "ResidentNonresident": "@(1,Resident/Non-resident)",
        "NationalityCountryofIncorporation": "@(1,Nationality/CountryofIncorporation)",
        "PermanantTownCity": "@(1,PermanantTown/City)",
        "SubsidiaryAssociateofanotherorganization": "@(1,Subsidiary/Associateofanotherorganization)",
        "Howdidyougettoknowaboutus": "@(1,Howdidyougettoknowaboutus?)",
        // trx_portfolio
        "UseBankAccountFromCustomer": "@(1,UseBankAccountFromCustomer?)"
      }
    }
},
  {
    "operation": "remove",
    "spec": {
      "*": {
        // trx_customer
        "Resident/Non-resident": "",
        "Nationality/CountryofIncorporation": "",
        "PermanantTown/City": "",
        "Subsidiary/Associateofanotherorganization": "",
        "NatureOf_Business": "",
        "Howdidyougettoknowaboutus?": "",
        //trx_portfolio
        "UseBankAccountFromCustomer?": ""
      }
    }
} /**/
]

Hope that solve your problem.

If you found this is helpful, please accept the solution.

Thanks