Coder Social home page Coder Social logo

fcica / medium-onedit-pitfalls Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wildh0g/medium-onedit-pitfalls

0.0 0.0 0.0 1 KB

The onEdit trigger can feel unreliable and messy, but when done right it is powerful and reliable.

JavaScript 100.00%

medium-onedit-pitfalls's Introduction

Three Pitfalls to Avoid When Using the onEdit Trigger in Google Apps Script

The onEdit trigger can feel unreliable and messy, but when done right it is powerful and reliable.

The onEdit trigger is likely the most used trigger in Google Apps Script. It runs automatically with an event object whenever you change a value in a spreadsheet - programmatic changes excluded - thus allowing you to execute a script based on context. When done properly, it can be extremely powerful. When done wrong, however, it can feel unreliable and messy. In this article, we will learn to avoid three common pitfalls:

  • Not Exiting Early
  • Making a Single Function Do Everything
  • Expecting onEdit to Catch All Changes by Default

For this purpose, we will build a simple script to handle a task list in Google Sheets. It will do two things: add a checkbox next to new tasks and add a completion date when each task is checked as done.

Read the full article

medium-onedit-pitfalls's People

Contributors

wildh0g 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.