Git Product home page Git Product logo

typeform-export-excel's Introduction

typeform-export-excel

Export a Typeform survey questionnaire to an Excel format

npm version license downloads build Known Vulnerabilities Security Responsible Disclosure

About

This library exports a Typeform survey to an Excel file with already aggregated results for all questions and their answers, and includes a tiny CLI helper to do this from command-line.

Benefits over Typeform's CSV export:

  • Organized data: Each question is represented in its own worksheet.
  • De-normalized: Each question has all the aggregated answers counts already present in the worksheet in an organized manner.
  • Graph-ready: Data points are presented in a table structure allowing you to easily create a graph out of it.

Install

npm install typeform-export-excel

Usage (Library)

const TypeformExportExcel = require('typeform-export-excel')

// NEVER EVER STORE SENSITIVE DATA IN YOUR SOURCE CODE
// THIS IS JUST FOR THE SAKE OF EXAMPLE AND BREVITY
const apiKey = '1234'
const formId = 'Pdi981'

const typeformToExcel = new TypeformExportExcel({
  credentials: {
    apiKey: apiKey
  },
  workbookConfig: {
    creator: 'Liran',
    date: new Date()
  }
})

typeformToExcel
  .createWorkbookFromForm(formId)
  .then(() => {
    return typeformToExcel.writeToFile({
      filename: 'out.xlsx',
      isDated: true
    })
  })
  .then(() => {
    debug(`Successfully exported: ${fileName}`)
  })
  .catch(error => {
    console.error(`Error: ${error.message}`)
    debug(error.stack)
  })

Usage (CLI)

Once installed, a binary named typeform-export-excel will be available on the path.

The following is supported command line arguments:

Option Name Option Value Description
--apiKey 1234 typeform's api key, for example: --apiKey 1234
--formId Pdi981 the relevant form id, usually shows up in the URL, for example: --formId Pdi981
--filename out.xlsx the filename to create and write to, for example: --filename out.xlsx
--dated (optional) the argument for adding export date to filename, for example: --dated

Example:

$ typeform-export-excel --apiKey 1234 --formId Pdi981 --filename survey-results.xlsx --author Liran

Related

@lirantal/typeform-client - A friendlier Typeform Node.js API client

Contributing

Please consult CONTIRBUTING for guidelines on contributing to this project.

Author

typeform-export-excel © Liran Tal, Released under the Apache-2.0 License.

typeform-export-excel's People

Contributors

arszh avatar lirantal avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

arszh

typeform-export-excel's Issues

Test matches passes when the files are't the same

Test "Creating an Excel file from form matches previous sample file'"passes when the files are't the same , because expect inside 'try/catch'. Jest has issue #3917 about this problem.

There is also a problem that the actual file from "sample.xlsx" and the exported file have different sizes.

actual value to equal:
  7793
expected:
  7823

Expected Behavior

if a actual and a expected files have different sizes then test fails

Current Behavior

Test always passes.

Possible Solution

  1. Remove "try/catch" because it also prevents find errors and situations where exceptions are raised.
  2. Use cvle's gist

Steps to Reproduce (for bugs)

  1. change expected.size or actual.size to any number
  2. run test
  3. test passed

Context

I met this problem when worked on #12

Your Environment

  • Library Version used: 1.0.6
  • Node.js version (e.g. Node.js 5.4): v12.13.1
  • Operating System and version (desktop or mobile): macOS Catalina 10.15.1

Output filename should use a date generated filename

Expected Behavior

Make sure the output filename being generated is based on a date/time so we don't override output files on every typeform export run.

Current Behavior

Filename is exported as a static, non-changing name and gets overriden.

Cannot read property 'totalRespondents' of undefined

When running

$ typeform-export-excel --apiKey test1234 --formId iGifhW --filename survey-results.xlsx --author Adriaan

Expected Behavior

I expect it to create a download file.

Current Behavior

Error: Cannot read property 'totalRespondents' of undefined

Context

Just want to download the questions, because I can't export them in the Typeform itself.

Your Environment

  • Library Version used: [email protected]
  • Node.js version (e.g. Node.js 5.4): v13.0.1
  • Operating System and version (desktop or mobile): desktop

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.