Merge JSON together by key
Hi Team,
I'm new to the platform and am having some issues manipulating the data how I want it to look.
I'm getting my initial data from a SQL database (skusByLocation), and then am doing a lookup from a CSV file (FTP) (eandata).
I want to merge skusByLocation and eandata together utilising the sku as the key. Whats the best way to do this?
Input:
{
"data": [
{
"skusByLocation": [
{
"location": "753",
"skus": [
{
"sku": "1234",
"quantity": 3
},
{
"sku": "5678",
"quantity": 3
}
]
}
],
"eandata": [
{
"sku": "1234",
"ean": "efgh"
},
{
"sku": "5678",
"ean": "abcd"
}
]
}
]
}
Desired Output:
{
"data": [
{
"skusByLocation": [
{
"location": "753",
"skus": [
{
"sku": "1234",
"quantity": 3,
"ean": "efgh"
},
{
"sku": "5678",
"quantity": 3,
"ean": "abcd"
}
]
}
]
}
Thanks.
Comments
Morgan Jenkins this could be tricky so I have a few questions:
Hi Tyler Lamparter,
1. The CSV is 1 large file with every sku / ean
2. Currently there are 9100 skus in the csv.
3. Ultimately the data will be sent to a REST endpoint.
Morgan Jenkins that's sort of what I was figuring. In that case, you will most likely hit the 5 MB page size limit because you're basically adding 9100 objects per record per page that is passing through that lookup step. I think your best options are:
Please sign in to leave a comment.