Hello! I am very new to APIs and JSON. I’m hoping that someone can confirm what I think the solution to my problem is. I suspect that the issue described below needs to be dealt with using Javascript code in the Zapier Integration I created.
The integration pulls data through an API request using a Presentation ID#. The data is a sales presentation with multiple Promotional items and complex pricing details. Each item uses the same signifiers for qtys, sell prices, additional charges, etc. Some output arrays of different lengths, others a single value.
Zapier is grouping the like named data from all Promo items into comma separated text. Due to the variations in array sizes, I can’t easily pull the data apart in Zapier.
Below is a significantly simplified example of the received JSON data.
Here are examples of how the data is being groupedin Zapier. This is from a presentation with four Promo Items. The sample JSON data is two items to reduce the number of lines.
Please note this data will be used for immediate output and not stored. The data doesn’t need to be unique across multiple requests.
I’m assuming that the answer to this problem is adding a prefix to “qtys” from either the “sortOrder” or “presItemId” value to create “0qtys” or “47600211qtys” respectively.
I’m hoping someone can confirm my assumptions and let me know that this has to be done through Javascript in the Zapier integration side, not the Zap side.
Thank you ahead of time to anyone that can offer help!
{
"presentations": j
{
"presId": 6835678,
"status": 4,
"client": {
"clientId": 3357473,
"company": "Merlin Magic",
"phone": "512-555-5885",
},
"itemCnt": 4,
"items": t
{
"presItemId": 47600211,
"sortOrder": 0,
"name": "Pinnacle Tumbler",
"itemNum": "RWFGH-DBVYP",
"includeItem": 1,
"qtys": t
"24",
"100",
"150",
"250",
"400",
""
],
"sellPrcs":
"25.18",
"24.18",
"22",
"22.18",
"19.98",
"0"
],
"addChgTotals": <
"133.74",
"450.64",
"133.74",
"133.74",
"1549.64",
"0"
],
"totals":
"738.06",
"2868.64",
"3433.74",
"5678.74",
"9541.64",
"0"
],
"setupChg": "55",
"shipChgs": 5
"78.74",
"395.64",
"78.74",
"78.74",
"1494.64",
"78.74"
],
"supplier": {
"sageId": "52344",
"company": "PCNA",
"phone": "800.555.1555",
"email": "example@pcna.com",
}
},
{
"presItemId": 47600212,
"sortOrder": 1,
"name": "Summit 40 oz Travel Mug",
"itemNum": "UGQBD-FNFRX",
"qtys": -
"20",
"100",
"240",
"500",
"1000",
""
],
"sellPrcs":
"18.5",
"17.45",
"16.95",
"16.45",
"15.95",
"0"
],
"addChgTotals": <
"148.86",
"371.01",
"60",
"60",
"60",
"0"
],
"totals":
"518.86",
"2116.01",
"4128",
"8285",
"16010",
"0"
],
"setupChg": "60",
"shipChgs": 6
"88.86",
"311.01",
"0",
"0",
"0",
"0"
],
"supplier": {
"sageId": "60462",
"company": "Ariel Premium Supply Inc",
"phone": "800.555.7474",
"email": "example@arielpremium.com",
}
}
]
}
]
}