Giter Club home page Giter Club logo

gsheettopdf's Introduction

gSheetToPDF

Send a PDF (from data in Google Sheet) by email according a choice in Google Form. Many thanks to Jason Huang and his article How to Print Google Sheet to PDF Using Apps Script and also [Amit Agarwal](Amit Agarwal) and his article How to Add Options in Google Forms Questions from Google Sheets for the populate form part.

How it works

Google Forms

A gForms with 2 questions: email address and a checkbox The checkbox is a list of all data available. Can be a list of employers, for example.

Documentation of Google Sheet API here

Google Sheet

A gSheet with 2 sheets:

  • One with all data
  • One where the PDF will be generated using data from the other sheet

The data sheet is a list of products identified by two IDs (name and brand), one line for one product. My PDF sheet refers to 2 cells (R5 and S5) via vlookup function. When the script will change those cells the PDF sheet will change (due to reference) and will display all data (from the data sheet) for the selected product.

Documentation of Google Sheet API here

App Script

After the form submission, the script in main.js will :

  • Fetch responses from the gForms
  • Actualize the sheet with those responses (preparation for the PDF)
  • Create the PDF file from the sheet
  • Send this PDF by email

You need to copy the content of main.js into a file in App Script from your Google Forms (to be linked), see documentation.

Before sending the PDF by email, this file is stored into Google Drive for a moment.

gsheettopdf's People

Contributors

liscare avatar

Stargazers

 avatar

Watchers

 avatar

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.