typeform-parse

Javascript library made to parse typeform responses

Usage no npm install needed!

<script type="module">
  import typeformParse from 'https://cdn.skypack.dev/typeform-parse';
</script>

README

Typeform-parse

Javascript library made specifically to parse typeform responses, is able to parse any type for questions and return the submitted reponses, regardless if they are simple "text" or multiple "choice"

Note: See examples.js for more examples on how to use the lib

Usage:

const typeformParse = require('typeform-parse')

// create this yourself and match the question ref-ids from typeform dashboard
const refMap = { answer1: "5a69fc2b-07ca-42f2-bfbb-8eace6da6d9f" };

// you'll get this from typeform within reponses api and webhooks
const answers = [ 
  {
    field: {
      id: "83P8UV3K7yMs",
      ref: "5a69fc2b-07ca-42f2-bfbb-8eace6da6d9f",
      type: "multiple_choice",
    },
    type: "choice",
    choice: { id: "3FOG4jSbHR1R", label: "test response" },
  }
];

// Output - { answer1:  'test response' } 
const result = typeformParse(refMap, answers) 

Author:

umairx97