# Send me the record

**URL:** <https://community.glideapps.com/t/send-me-the-record/41158>\
**Category:** Ask for Help\
**Created:** [April 24, 2022, 2:11am UTC](https://community.glideapps.com/t/send-me-the-record/41158 "2022-04-24T02:11:26Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)\
**Post date:** [April 24, 2022, 2:11am UTC](https://community.glideapps.com/t/send-me-the-record/41158/1 "2022-04-24T02:11:26Z")

</div>

Hi everyone,  
The schema of the student table below illustrates the exchange of lecturers in each assessment activity for a number of students. In addition, I also have a list of lecturers that I relate to display this assessment form per student to be displayed in Glide.

I want to create a “Send me the record” button to partially and limitedly email according to the lecturer who inputs the value. The form of the email can be in the form of a pdf attachment or in the form of an Html table.  
Can anyone give an idea to collect and display the partial data in tabular or pdf form?  
Thank you

 ![Screenshot 2022-04-24 084146](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/5/8552007ed32f6a403a322f2109549f0ffb49bf8c.png)

---

<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:** [April 24, 2022, 10:16am UTC](https://community.glideapps.com/t/send-me-the-record/41158/2 "2022-04-24T10:16:06Z")

</div>

maybe this will help… sample:

> **[Personal Time Card DEMO](https://time-card-demo.glideapp.io/dl/ewAiAHQAIgA6ADAALAAiAHMAIgA6ACIAYwBsAGEAcwBzAC0AVABpAG0AZQAgAEMAYQByAGQAIgAsACIAcgAiADoAIgBIAHMAcAB1AEUAcwAzAEgAVABGAEcARQA1AG4ANwAyAHQAZQBKADYAWABRACIALAAiAG4AIgA6ACIAUABlAHIAcwBvAG4AYQBsACAAVABpAG0AZQAgAEMAYQByAGQAIgB9AA==)**
>
> Track your working hours, sort by week, month, or year. Export as PDF files

---

<div class="post-metadata">

**Author:** ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)\
**Post date:** [April 24, 2022, 1:59pm UTC](https://community.glideapps.com/t/send-me-the-record/41158/3 "2022-04-24T13:59:03Z")

</div>

Hi Uzo,  
Can you describe your application workflow?

I have a complete list of lecturers with their email data and I expect the email to be sent simply by pressing the “_send me the record_” button or some kind of download button without filling in a number of entries except the order of the assessment as requested.  
I learned a bit about how to create an Html table template by pulling data from a spreadsheet, but what’s still confusing is how the email can be triggered from the button.  
Maybe I need some time to do some testing myself but I haven’t found the concept of thinking, especially regarding who presses the button and the data to be given.

---

<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:** [April 24, 2022, 2:28pm UTC](https://community.glideapps.com/t/send-me-the-record/41158/4 "2022-04-24T14:28:39Z")

</div>

hi… simply have a button with action to set some value in GS, in my case, I write filter option, week, month, year, or all data… that will set filtering in GS to pull all matched data into PDF sheet… that action also will fire onChange trigger to run a script that creates and email PDF files of that sheet.

---

<div class="post-metadata">

**Author:** ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)\
**Post date:** [April 24, 2022, 3:04pm UTC](https://community.glideapps.com/t/send-me-the-record/41158/5 "2022-04-24T15:04:40Z")

</div>

Ok. The value will be written in the spreadsheet, then does the value need to be deleted so that later it can be requested again for the same report?

---

<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:** [April 24, 2022, 3:18pm UTC](https://community.glideapps.com/t/send-me-the-record/41158/6 "2022-04-24T15:18:53Z")

</div>

no, it will be overwritten by the next request… you might add some unique value to it (like a timestamp), so it will change the value for the onChange trigger, in case the next one is exactly the same

---

<div class="post-metadata">

**Author:** ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)\
**Post date:** [April 24, 2022, 3:31pm UTC](https://community.glideapps.com/t/send-me-the-record/41158/7 "2022-04-24T15:31:29Z")

</div>

What kind of script from the value?  
I haven’t and will try to make one. I’ll need the next few days to try it out. Maybe I’ll bother you again.

---

<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:** [April 24, 2022, 3:35pm UTC](https://community.glideapps.com/t/send-me-the-record/41158/8 "2022-04-24T15:35:20Z")

</div>

this is a lot of work, especially when you doing it for the first time… you might consider getting my template 😉

---

<div class="post-metadata">

**Author:** ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)\
**Post date:** [April 24, 2022, 3:41pm UTC](https://community.glideapps.com/t/send-me-the-record/41158/9 "2022-04-24T15:41:21Z")

</div>

Previously I had a very long Html email template that I used to upload files with Bootstrap components rendered with webviews in Glide. I only need to partially overhaul especially the trigger from Glide.  
Maybe you can give some snippets is enough.

---

<div class="post-metadata">

**Author:** ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)\
**Post date:** [April 25, 2022, 1:26am UTC](https://community.glideapps.com/t/send-me-the-record/41158/10 "2022-04-25T01:26:59Z")

</div>

First I need to extract the data for me to place the data inside the email template. I think here we need a (vlookup, query, or else) formula to match multiple conditions (name from the requester, how many reviews, and the title of the teacher who requested it). The rest I think I can work out.  
Maybe @ThinhDinh would like to help me with the formula. Thank you in advance.

Teacher sheet:

 ![Screenshot 2022-04-25 081227](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/b/0b079ca5b97628ce27974b36a30e5f92561ef3f2.png)

Email template:

 ![Screenshot 2022-04-25 081144](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/f/cfa417cf409fc6b8a491845ea5c88292c59a8bb0.png)

---

<div class="post-metadata">

**Author:** ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)\
**Post date:** [April 25, 2022, 2:38am UTC](https://community.glideapps.com/t/send-me-the-record/41158/11 "2022-04-25T02:38:24Z")

</div>

To reduce column repetition, I changed the assessment data table to be as below.

 ![Screenshot 2022-04-25 093355](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/9/994d6c8c191ea644356536bb984f3d4158edee93.png)

---

<div class="post-metadata">

**Author:** ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)\
**Post date:** [April 25, 2022, 11:35am UTC](https://community.glideapps.com/t/send-me-the-record/41158/12 "2022-04-25T11:35:03Z")

</div>

I have had success using the query formula and the if function.  
Thank you for all.

---

<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:** [April 25, 2022, 11:40am UTC](https://community.glideapps.com/t/send-me-the-record/41158/13 "2022-04-25T11:40:49Z")

</div>

the best practice is to use only vlookup, which will make faster changes… trigger might take data before the query finishes… and your PDF might be incomplete when contains lots of data…  
Use `SpreadsheetApp.flush();` in your script to assure full upload.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [April 26, 2022, 11:41am UTC](https://community.glideapps.com/t/send-me-the-record/41158/14 "2022-04-26T11:41:18Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
