Question

How do I pass-through ChatGPT extracted structured in json with proper data types?

  • 8 November 2023
  • 1 reply
  • 426 views

I’m extracting email data with ChatGPT using the “Extract Structured Data” feature. I have specified data types and possible values.
I want to send the parsed data as a POST request using the “Webhook by Zapier” feature.

Here’s what I’ve tried:

  • Sending a custom POST request with Data Pass-Through = True and a header with Content-Type=application/json. What happens then is that the json returned has single quotes instead of double-quotes and booleans have a capital letter
  • Send a POST request with a json payload type (and adding no data). The json returns all values as strings (even if some types specified in the “Extract Structured Data” are number and boolean)

  • Send a POST request with a json payload type (and adding all fields and matching them with Extract Structured Data field outputs). The json returned returns all values as strings and does not nest the fields properly

     

  • For the first two methods, I’ve considered using the formatter by Zapier, but I can’t select the entire output, only every single field from the the “Extract Structured Data” step.

Is there a trick I should know about to return a proper json with the right type? 


1 reply

FYI I’ve solved it temporarily and very unelegantly by using a custom POST request with Data Pass-Through = True and a header with Content-Type=application/json that is then received by another zap where a conversion happens in python before being sent to “real” url.

Reply