Using Formatter or Code, it is challenging to flatten a complex data structure using Zapier.
STEPS:
- From a custom ChatGPT, “Send Data” a JSON structure with arrays and arrays within an array element.
- Capture data using Webhooks. Data captured correctly and successfully
- Use Formatter to structure the data in a desired manner to write to Google Sheets, Failed
- Expected Results: Picking up data from Webhooks, I could organize the data to easily write to Google Sheets
- Actual Results: Formmatter recognizes the data as form elements concatenating each array element into a comma delimited string. This forces multiple formatters that require me to structure the data for the level 1 array and another for the level 2 array.
- Create 2 Formatter using Utilities/Line Itemizer to structure both the level 1 and level 2 arrays
- Expected Results: Each array element, with multiple fields to be structured correctly
- Actual Results: The structures were correct however the level 2 array created 5 individual records that should have been 3. each record properly associated to the correct level 1 array.
- Use Code Javascript (should have used python) to structure the code as a flat record so that the level 2 array is properly associated to the level 1.
- Expected Results: The output to be structured to easily write to google sheets
- Actual Results: Zapier reverted the data to the original webhooks format because the Code produced the arrays within an arrays again.
Expected Results: The formatter to have a feature that flattens the array structure in the correct order
Actual Results: It’s a struggle to use the built-in features to structure it properly. Without the proper structure, it will not write the output to google sheets correctly. Sometimes duplicating records, missing records etc.
Workaround: Developing code to structure each array element as a line item and to properly associate the level2 array with the level 1 entries correctly (still working on this :)).