I am developing a Zap trigger that is pretty straight forward. Event happens (let’s say a donation) → Zapier Code to parse a field → map output fields to another application. One of the fields in the sending app contains some custom data, which is basically array of objects. In the trigger webhook I encode this data as a json string.
In order to parse this out, I use the Zapier Code step. I take the data from the field, run JSON.parse on it and then map the output fields. All if this is working when I test the code step. I am also able to test the final step and output to a sample spreadsheet.
All of this is failing on the Code step when I try it with an actual live Zap. It appears that Zapier is automatically parsing the json encoded string and turning it into some wonky string format (like field 1 label value 2 label value). I am definitely sending a json STRING in my trigger webhook. Just for fun I sent two fields, one with raw json and the other with the json string and it displays both fields with the same “output” in the step before the Code step.
As another test I added some dummy text in front of the json string. Zapier at that point recognizes the incoming field as a string. I then in the Code step split the string first and JSON.parse the remainder. That ended up working but it’s an ugly hack.
Is there something I’m not aware of on how Zapier handles incoming json strings?
-----
Here is what I’m sending to my trigger:
This is what Zap creates as “output” before sending to my Code step which causes it to fail. As you can see it’s exactly the same json encoded vs no json.