Some json strings questions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2021 12:56 AM
Hi
We are just starting off with SnapLogic and we wonder if somebody can give us some answers to the following questions.
We have the following input
[
{
transactionId:“F59AE026-8AEA-4F69-BE97-F7AB981AC3BF”,LineCreationSequenceNumber:1,ItemNumber:“99999999991”,OrderedSalesQuantity:1,SalesPrice:120,AVAPromotionCode:null,SalesUnitSymbol:“UN”,SalesProductCategoryName:null,AVALaserText:null,AVAWrappingText:null,
original:{erpOrderNumber:“JEM-99999”,clientOrderNumber:“00118204”}
},
{
transactionId:“F59AE026-8AEA-4F69-BE97-F7AB981AC3BF”,LineCreationSequenceNumber:2,ItemNumber:“99999999994”,OrderedSalesQuantity:2,SalesPrice:80.93,AVAPromotionCode:null,SalesUnitSymbol:“UN”,SalesProductCategoryName:null,AVALaserText:null,AVAWrappingText:null,
original:{erpOrderNumber:“JEM-99999”,clientOrderNumber:“00118205”}
}
]
I have the following questions
- How do we remove the “original” object from the lines with expression language?
- How can we remove key "transactionId"and value from the lines with expression language?
- Once the original object is removed how can we convert the lines into an array with name “orderLines” with expression language?
Thanks for your help

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2021 10:34 AM
Hey @vcocco,
The sample data provided is incorrect. First, it’s not properly formatted. While posting data samples or expressions, you should always use the “Preformatted text” option.
Second, the Keys in JSON should always be in double quotes, and values to, if they are string of course. You can read more about JSON on the following link:
But as a contrast for better understanding, I formatted the same sample in the right format:
[
{
"transactionId": "F59AE026-8AEA-4F69-BE97-F7AB981AC3BF",
"LineCreationSequenceNumber": 1,
"ItemNumber": "99999999991",
"OrderedSalesQuantity": 1,
"SalesPrice": 120,
"AVAPromotionCode": null,
"SalesUnitSymbol": "UN",
"SalesProductCategoryName": null,
"AVALaserText": null,
"AVAWrappingText": null,
"original": {
"erpOrderNumber": "JEM-99999",
"clientOrderNumber": "00118204"
}
},
{
"transactionId": "F59AE026-8AEA-4F69-BE97-F7AB981AC3BF",
"LineCreationSequenceNumber": 2,
"ItemNumber": "99999999994",
"OrderedSalesQuantity": 2,
"SalesPrice": 80.93,
"AVAPromotionCode": null,
"SalesUnitSymbol": "UN",
"SalesProductCategoryName": null,
"AVALaserText": null,
"AVAWrappingText": null,
"original": {
"erpOrderNumber": "JEM-99999",
"clientOrderNumber": "00118205"
}
}
]
