Skip to main content


Hi everyone,

I'm trying to create a Zapier automation to generate Typeform quizzes directly from lecture transcripts. Here's my workflow so far:

  1. Tactiq: This app transcribes my lectures into text.
  2. ChatGPT API: I'm using the ChatGPT API to generate multiple-choice questions and answers in JSON format based on the transcript.
  3. Code by Zapier: This step successfully takes the ChatGPT output (which is a JSON array of question objects) and stores it in a variable called typeformFields.

Here's where I'm stuck:

4. Typeform API: I'm using the "Create Form" action to create a new Typeform. However, I'm unsure how to correctly reference the typeformFields variable in the API's body data.

Here's what I have in the Body:

JSON

{
"title": " QUIZ",
"fields": [
{
"type": "short_text",
"title": "What is your name?",
"validations": {
"required": true
}
},
{
"type": "multiple_choice",
"title": "What is the primary purpose of dental implants according to the speaker?",
"properties": {
"choices": [
{"label": "To improve speech and pronunciation"},
{"label": "To provide functional and aesthetic oral rehabilitation"},
{"label": "To enhance facial appearance only"},
{"label": "To prevent tooth decay"}
],
"randomize": false,
"allow_other_choice": false
},
"validations": {
"required": true
}
},
{
"type": "multiple_choice",
"title": "Which material is most commonly used for dental implants?",
"properties": {
"choices": [
{"label": "Stainless steel"},
{"label": "Titanium"},
{"label": "Aluminum"},
{"label": "Gold"}
],
"randomize": false,
"allow_other_choice": false
},
"validations": {
"required": true
}
},
{
"type": "multiple_choice",
"title": "What is grade 23 titanium alloy known for compared to grade 4 and grade 5?",
"properties": {
"choices": [
{"label": "Higher nitrogen content"},
{"label": "Lower flexibility"},
{"label": "Extra low interstitial elements"},
{"label": "Higher iron content"}
],
"randomize": false,
"allow_other_choice": false
},
"validations": {
"required": true
}
},
{
"type": "multiple_choice",
"title": "What does RBM stand for in the context of surface treatment for dental implants?",
"properties": {
"choices": [
{"label": "Reactive Blasting Method"},
{"label": "Resolvable Blasting Media"},
{"label": "Rapid Blasting Mechanism"},
{"label": "Residual Blasting Material"}
],
"randomize": false,
"allow_other_choice": false
},
"validations": {
"required": true
}
},
{
"type": "multiple_choice",
"title": "Which surface treatment is associated with using aluminum oxide particles?",
"properties": {
"choices": [
{"label": "RBM"},
{"label": "SLA"},
{"label": "SBM"},
{"label": "ELI"}
],
"randomize": false,
"allow_other_choice": false
},
"validations": {
"required": true
}
},
{
"type": "multiple_choice",
"title": "What problem is associated with the SLA surface treatment?",
"properties": {
"choices": [
{"label": "Residual calcium phosphate"},
{"label": "Coating failure"},
{"label": "Contamination from aluminum oxide particles"},
{"label": "Insufficient roughness"}
],
"randomize": false,
"allow_other_choice": false
},
"validations": {
"required": true
}
},
{
"type": "multiple_choice",
"title": "What type of implants are placed in the jaw bone and protrude through the gum?",
"properties": {
"choices": [
{"label": "Zygomatic implants"},
{"label": "Subperiosteal implants"},
{"label": "Endosteal implants"},
{"label": "Pterigoid implants"}
],
"randomize": false,
"allow_other_choice": false
},
"validations": {
"required": true
}
},
{
"type": "multiple_choice",
"title": "What is the significant discovery attributed to Dr. Brenemak in 1929?",
"properties": {
"choices": [
{"label": "The invention of dental implants"},
{"label": "Titanium's strong adhesion to bone"},
{"label": "The first use of grade 23 titanium"},
{"label": "Development of SLA surface treatment"}
],
"randomize": false,
"allow_other_choice": false
},
"validations": {
"required": true
}
},
{
"type": "multiple_choice",
"title": "Why is the RBM surface treatment considered highly osteo-conductive?",
"properties": {
"choices": [
{"label": "It uses non-biocompatible materials"},
{"label": "It involves a strong acid etch"},
{"label": "It uses biocompatible materials like calcium phosphate"},
{"label": "It provides a smooth surface"}
],
"randomize": false,
"allow_other_choice": false
},
"validations": {
"required": true
}
},
{
"type": "multiple_choice",
"title": "What is the main advantage of grade 23 titanium alloy over commercially pure titanium?",
"properties": {
"choices": [
{"label": "It is more flexible"},
{"label": "It has a smoother surface"},
{"label": "It has significantly increased tensile strength"},
{"label": "It is easier to manufacture"}
],
"randomize": false,
"allow_other_choice": false
},
"validations": {
"required": true
}
}
]
}

When I use this, it creates the form in Typeform, however I want it to transfer the output from ChatGPT questions/answers directly via Code by Zapier output into API by Typeform.

When I test this step, I get a "400 Bad Request" error. I believe this is because I'm not correctly inserting the questions from the typeformFields variable.

I'm looking for help on how to correctly format the JSON body data in the Typeform API step to dynamically insert the questions generated by ChatGPT. Any guidance would be greatly appreciated!

Thanks in advance so much!!!