# App Script OnChange

**URL:** <https://community.glideapps.com/t/app-script-onchange/38697>\
**Category:** Ask for Help\
**Created:** [February 19, 2022, 6:02am UTC](https://community.glideapps.com/t/app-script-onchange/38697 "2022-02-19T06:02:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bungchow\_DigiLearn](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/bungchow_digilearn/32/33877_2.png) [@Bungchow\_DigiLearn](https://community.glideapps.com/u/Bungchow_DigiLearn)\
**Post date:** [February 19, 2022, 6:02am UTC](https://community.glideapps.com/t/app-script-onchange/38697/1 "2022-02-19T06:02:01Z")

</div>

Hi Gliders,

I can create PDF file, but it’s manually by click run button. And, very happy because Glide page is able to show cool image from the it’s PDF file’s Url.

 ![Invoice PDF](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/b/4b03089f8131c2720ca960f257c943ebae0408b5.jpeg)

Then, I need to create app script On Change for creating Invoice PDF fired automatically by input new data from Glide page on certain sheet (“invoice sheet”). I’ve tried some OnChange app script examples from internet. But, they didn’t work well. Still running automatically for all sheets/workbook changes. Any suggestion for doing that?

 ![App Script Invoice PDF](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/4/34b9348e67ec0ab8784b28ce3ceb95b4294b282e.jpeg)

The last one, is it possible to submit a free page template with app script/google sheet formula? Anyway, thank you in advance. Stay healthy and happy always!

---

<div class="post-metadata">

**Author:** ![SantiagoPerez](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/santiagoperez/32/16807_2.png) [@SantiagoPerez](https://community.glideapps.com/u/SantiagoPerez)\
**Post date:** [February 19, 2022, 1:01pm UTC](https://community.glideapps.com/t/app-script-onchange/38697/2 "2022-02-19T13:01:19Z")

</div>

Apps/Pages that rely on scripts, formulas, etc that are not native to Glide are not approved.

Most of the people that get templates from us are non technical people that will get really confused by these types of automations.

---

<div class="post-metadata">

**Author:** ![Bungchow\_DigiLearn](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/bungchow_digilearn/32/33877_2.png) [@Bungchow\_DigiLearn](https://community.glideapps.com/u/Bungchow_DigiLearn)\
**Post date:** [February 19, 2022, 1:24pm UTC](https://community.glideapps.com/t/app-script-onchange/38697/3 "2022-02-19T13:24:06Z")

</div>

Well noted. I’m trying to revise my page template as Glide’s guidelines. Thanks @SantiagoPerez

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [February 19, 2022, 1:53pm UTC](https://community.glideapps.com/t/app-script-onchange/38697/4 "2022-02-19T13:53:51Z")

</div>

to run triggered function only for change in your invoice sheet… simply make the condition:

```auto
var s = SpreadsheetApp.getActiveSheet();
if(s.getName() == "invoice") { //rest of the function

```

you can add more conditions to narrow down the trigger

---

<div class="post-metadata">

**Author:** ![Bungchow\_DigiLearn](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/bungchow_digilearn/32/33877_2.png) [@Bungchow\_DigiLearn](https://community.glideapps.com/u/Bungchow_DigiLearn)\
**Post date:** [February 21, 2022, 7:15am UTC](https://community.glideapps.com/t/app-script-onchange/38697/5 "2022-02-21T07:15:26Z")

</div>

It’s still running when any changes on other sheets. That’s fine, I’ll try to find another solution.

Anyway, thanks a lot @Uzo

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [February 21, 2022, 1:18pm UTC](https://community.glideapps.com/t/app-script-onchange/38697/6 "2022-02-21T13:18:20Z")

</div>

it can’t be… did you put that at the beginning of the function that is attached to the trigger and save it? also, I’m looking at the image of your script… you probably don’t need to separate it with different functions… the first function is not doing anything, it only read 2 values.
