Question

Passing Array as InputData when array is not indeed


I receive data from my Trigger that arrives in an array or object that uses dates as a key:

This data is essential for me to iterate and format, but I’m having a difficult time using it in Zapier Code. {{idnumber__dates}} is not a valid input, {{239145184__dates__2024-06-27}} is, but arrives as a single integer. It would seem that I would need to know the dates used in advance in order to call this as well as have a limit to how many come in. Are there graceful solutions to this?

 

 


4 replies

Userlevel 7
Badge +14

Hi @BDA Integrations 

Yeah, that can be tricky and not ideal to work with data as an object like that.

You’d need access to the underlying RAW JSON to then use Code to convert those key/value pairs in the object to arrays.

 

 

Userlevel 7
Badge +14

@BDA Integrations 

Once you have access to the RAW JSON, a Code step can be used to convert the object to an array. (example)

 

Hi Troy, I really appreciate the concept behind this approach, as I believe bringing the raw JSON into the code step would allow me to meaningfully parse the data. Unfortunately, it would seem that, even with leaving the key-value pairs empty, my Catch Hook receives the data just about the same as it received it from BambooHR.

 

From the ZapierCode step, trying to add a variable (Ideally Raw JSON) to the Input Data:

 

Unsure if I did something incorrect for it to format this way after sending it through WebHooks.

Userlevel 7
Badge +14

@BDA Integrations 

Did you try using this Zap trigger: Webhook - Catch RAW Hook

 

Reply