Closed yesluck closed 1 year ago
Hi Team,
I am currently using Jolt to work on this input:
{ "banking_account": { "accounts": [ { "accountId": "account1" }, { "accountId": "account2", "nickname": "nickname2" } ] }, "account_balance": { "total_value": { "currency_code": "USD", "value": "100.00" }, "balance_accounts": [ { "id": "id1" }, { "id": "id2" } ] } }
And the expected output is:
{ "Data": { "Accounts": [ { "AccountId": "account1", "Account": { "Identification": [ "id1", "id2" ] }, "Currency": "USD" }, { "AccountId": "account2", "NickName": "nickname2", "Account": { "Identification": [ "id1", "id2" ] }, "Currency": "USD" } ] } }
And here is my current spec:
[ { "operation": "shift", "spec": { "banking_account": { "accounts": { "*": { "accountId": "Data.Accounts.[&1].AccountId", "nickname": "Data.Accounts.[&1].NickName" } } }, "account_balance": { "total_value": { "currency_code": "Data.Accounts.[&1].Currency" }, "balance_accounts": { "*": { "id": "Data.Accounts.[&1].Account.Identification" } } } } } ]
And here is my current output:
{ "Data": { "Accounts": [ { "AccountId": "account1", "Account": { "Identification": "id1" } }, { "AccountId": "account2", "NickName": "nickname2", "Account": { "Identification": "id2" } } ] } }
So I am having two questions:
Why is the "Currency" value missing? Even if I added something like
"account_balance": { "total_value": { "currency_code": "Data.Accounts.[&1].Currency" } }
How to map both two balances accounts to both two accounts? Now it seems like an 1->1 mapping; and I wish to have a 2*2 mapping.
Thanks a lot for your help in advance!
Resolved in https://stackoverflow.com/questions/74053653/having-issue-when-adding-a-common-value-to-every-elements-in-array-using-jolt
Hi Team,
I am currently using Jolt to work on this input:
And the expected output is:
And here is my current spec:
And here is my current output:
So I am having two questions:
Why is the "Currency" value missing? Even if I added something like
How to map both two balances accounts to both two accounts? Now it seems like an 1->1 mapping; and I wish to have a 2*2 mapping.
Thanks a lot for your help in advance!