Members-only tutorial

Watch the video and get the practice sheet with membership.

See membership options

Automate Help Desk Ticket Closing

About this Tutorial

Create a simple automated help desk ticketing system.
  • Create tickets
    Closed dropdown
  • Calculate time to close
    Create dashboard

Video Transcript

<div>00:00 We're going to create an automatic help desk ticketing closing system here. It's going to be very quick because we're going to create a Google Form Learn how to create and manage Google Forms for data collection. Opens in new tab .<br>00:08 We're going to create a closed picker. This is going to be an automatic thing we do through Apps Script Discover how to automate tasks in Google Sheets with Apps Script. Opens in new tab .

And then when we close our tickets, we're going to add a timestamp Understand how to use timestamps for tracking data changes. Opens in new tab .<br>00:16 So that we have a timestamp Understand how to use timestamps for tracking data changes. Opens in new tab from the form when we get the tickets, when they open, and a timestamp Understand how to use timestamps for tracking data changes. Opens in new tab when they close.<br>00:23 That means we can create a dashboard Create dashboards to visualize and analyze your data effectively. Opens in new tab that shows both how many open tickets are there, plus what is the average time to close.<br>00:30 So we can monitor this kind of number Explore how to work with numbers in Google Sheets. Opens in new tab . So let's go to tools, create a new form, and just get a very simple ticket.<br>00:41 So, help, fill in this help, and we'll help you.

You may have some other things you want to ask here, but we're just going to ask a basic short answer, or even paragraph of what's the issue.<br>01:00 You probably have some other things here, but let's publish Find out how to publish your Google Forms for public access. Opens in new tab this. Make sure it's published to anyone. Done. And we can fill this out as well.<br>01:13 And so we have our form responses. We're going to call this Tickets. So that's going to be the name of the sheet, and we'll add a few here.<br>01:31 Some issue, submit, Now let's look at that. We have this.

We'll actually change this to Unformatted Data Learn about managing and manipulating data in Google Sheets. Opens in new tab .<br>01:43 We're going to add a column here of Closed and Closed Time. How do we add this? Here, uh, actually, drop down menu.<br>01:55 Well, let's go up to Extensions, Apps Script Discover how to automate tasks in Google Sheets with Apps Script. Opens in new tab . We're going to need to do two things. We're going to need to write a function Get to know how to write and use functions in Google Sheets. Opens in new tab , and then we're going to need to trigger Understand triggers to automate actions in Google Sheets. Opens in new tab that function Get to know how to write and use functions in Google Sheets. Opens in new tab when the form is submitted.<br>02:07 So, what we're going to a function Get to know how to write and use functions in Google Sheets. Opens in new tab called setClosedDropDown. We'll have an event here.

We can shorten this to just e, so we don't have to type the word event all the time.<br>02:20 We get some very interesting information from this. We get the row that we're on. e. range Learn about selecting and manipulating ranges in Google Sheets. Opens in new tab .getRow. We have the sheet that we're on.<br>02:34 e. range Learn about selecting and manipulating ranges in Google Sheets. Opens in new tab .getSheet. And we're going to end up having to set sheet. getRange Discover how to retrieve specific ranges in your spreadsheet. Opens in new tab , the row, uh, but the column will be C, so 3. And we need to set data validation Create dropdown menus in Google Sheets for better data entry. Opens in new tab rule.<br>02:56 And a rule here. Well, what's going to be our rule? We need two things. We need a rule, and we need a drop-down.<br>03:08 Like, items.

So, spreadsheet Understand the basics of working with spreadsheets. Opens in new tab , app, .newDataValidation, .requireValueInRange, and our range Learn about selecting and manipulating ranges in Google Sheets. Opens in new tab , we're going to go get that actually, over here.<br>03:28 We're going to create a new sheet called Settings, CloseStatus. So in case you want to add more things here, so maybe closed, closed, open or in progress, that kind of thing.<br>03:50 We'll have these options here. So let's go get those. Drop down status range Learn about selecting and manipulating ranges in Google Sheets. Opens in new tab equals spreadsheet Understand the basics of working with spreadsheets. Opens in new tab app dot get active spreadsheet Learn how to reference the active spreadsheet in Apps Script. Opens in new tab dot get sheet by name.<br>04:06 Our name is going to be settings dot get range Learn about selecting and manipulating ranges in Google Sheets. Opens in new tab is going to be A to colon A.

So anything in that A column but not the header Explore the importance of headers in organizing your data. Opens in new tab and we're going to require value in range Learn about selecting and manipulating ranges in Google Sheets. Opens in new tab drop down status range Learn about selecting and manipulating ranges in Google Sheets. Opens in new tab and we want it to be true that it needs to be a Thank one of those options And we'll need to build this okay, so<br>04:39 What we're doing here is we're setting this closed drop down anytime.

We're on a row that row gets created When a Form is submitted.<br>04:49 So let's go create the trigger Understand triggers to automate actions in Google Sheets. Opens in new tab again Our two steps are we create the function Get to know how to write and use functions in Google Sheets. Opens in new tab and then second we create the trigger Understand triggers to automate actions in Google Sheets. Opens in new tab Let's go over to triggers on the left and then on the bottom right add trigger Understand triggers to automate actions in Google Sheets. Opens in new tab choose which function Get to know how to write and use functions in Google Sheets. Opens in new tab to run We'll use set closed drop down We'll have the from spreadsheet Understand the basics of working with spreadsheets. Opens in new tab and the select Understand the SELECT clause in Google Sheets queries. Opens in new tab <br>05:06 event type is on form submit Learn how to handle form submissions in Google Sheets. Opens in new tab We'll click save And now let's go submit another response One more, oh we do need to authorize before we actually get this triggered.<br>05:21 Let's click allow.

And there this trigger Understand triggers to automate actions in Google Sheets. Opens in new tab should show up there. And so if we get any errors we'll see the error Find solutions for common errors in Google Sheets. Opens in new tab rate here.<br>05:35 So let's add another one. One more issue. Let's click submit. We'll go back to our tickets. And here one more issue we have a drop down menu here.<br>05:46 Now we can click closed. So our next automation is going to be if we click closed in the C column on tickets.<br>05:52 Put in a timestamp Understand how to use timestamps for tracking data changes. Opens in new tab in D. So that we can compare these two timestamps A and D. So let's go back to our script.<br>06:03 And add another function Get to know how to write and use functions in Google Sheets. Opens in new tab . Function Get to know how to write and use functions in Google Sheets. Opens in new tab on tickets. Edit.

This time, we're using a built-in function Get to know how to write and use functions in Google Sheets. Opens in new tab . Not an installable one. This is a very simple trigger Discover how to use simple triggers in Apps Script. Opens in new tab .<br>06:19 This trigger Understand triggers to automate actions in Google Sheets. Opens in new tab will happen. We don't need to create the trigger Understand triggers to automate actions in Google Sheets. Opens in new tab ourselves. It'll be here automatically. We need a few things. Variable, we need to know what row we're on.<br>06:28 E. range Learn about selecting and manipulating ranges in Google Sheets. Opens in new tab .getRow. We need to know what column we're on. We need to know what sheet we're on.

And we can then say if sheet is equal to, we need two equal signs.<br>06:56 I think is tickets in all caps, ampersand, let's move this up a little bit so you can see it, now ampers, double ampersand means and, column equals three, we're in this set C column, we also need another value, variable value equals E dot value two equal signs, and value is equal to all caps close closed<br>07:31 , then what are we going to do?

We're going to go to spreadsheet Understand the basics of working with spreadsheets. Opens in new tab dot app dot get active spreadsheet Learn how to reference the active spreadsheet in Apps Script. Opens in new tab dot get sheet by name, tickets.<br>07:44 Dot get range Learn about selecting and manipulating ranges in Google Sheets. Opens in new tab row, same row we're on, and in the fourth column, set value new date. This sets a timestamp Understand how to use timestamps for tracking data changes. Opens in new tab , this new date.<br>08:00 And this will run when there's an edit, so let's check that that's correct. And if there's an error Find solutions for common errors in Google Sheets. Opens in new tab , we'll see over here in executions.<br>08:14 This is completed. Let's double check all this, logger.log row.<br>08:32 Maybe this sheet is not correct. What else do we need, huh? Value. Let's log those.

And that should trigger Understand triggers to automate actions in Google Sheets. Opens in new tab it as well.<br>08:54 Let's go back to our executions and see what log shows up. Oh, it's just sheet. So I think we need to sheet.getName.<br>09:14 Now let's try it. So we'll go here, we'll submit another response. And more issues. Submit. We have our drop-down menu and we want to close it.<br>09:29 And we have a timestamp Understand how to use timestamps for tracking data changes. Opens in new tab . Perfect. So now we can tell what is the close time. So in our, time to close in our sheet here.<br>09:39 Time to close. I'm going to write a function Get to know how to write and use functions in Google Sheets. Opens in new tab .

If C2 equals closed then we're going to take the closed time and minus the time, the original timestamp Understand how to use timestamps for tracking data changes. Opens in new tab to get the difference.<br>10:03 And if not, we'll just have it blank. So let's form the format Learn about formatting options to enhance your spreadsheet. Opens in new tab this to duration, I think. There we go.<br>10:16 So this is three minutes, seven minutes, this is five seconds. There you go. Uhm. We can change these to something like this.<br>10:29 We can also change this format Learn about formatting options to enhance your spreadsheet. Opens in new tab here, but let's add this value when we set closed dropdown Implement data validation to ensure data integrity. Opens in new tab .

Sheet. getRange Discover how to retrieve specific ranges in your spreadsheet. Opens in new tab , row, and column 5, setValue Understand how to set values in specific cells in Google Sheets. Opens in new tab .<br>10:51 Our value is going to be this formula Get familiar with the syntax used in Google Sheets formulas. Opens in new tab , but we want to make sure that, uh, the 2s and 2s here, or whatever row we're on.<br>10:58 So we're going to actually change these to, to backticks. Create a backtick here, and a backtick here. And instead of 2, we'll use a little bit of interpolation. Dollar sign Learn how to use the dollar sign for absolute references. Opens in new tab , and curly brackets.<br>11:12 This means every time we enter the number Explore how to work with numbers in Google Sheets. Opens in new tab , it'll be whatever the row is from our variable up here.

So now when we create a new help ticket, help me please submit, we have our formula Get familiar with the syntax used in Google Sheets formulas. Opens in new tab already there.<br>11:40 So we can hit closed, get timestamp Understand how to use timestamps for tracking data changes. Opens in new tab , and a duration. Again, this format Learn about formatting options to enhance your spreadsheet. Opens in new tab of this duration can probably be fixed to some extent.<br>11:52 So I think it's probably best to just wrap Discover how to wrap text in cells for better readability. Opens in new tab this with text, and have hours, minutes, and seconds, but also part of perhaps maybe even days here.<br>12:07 If you have more than, need more than hours. So let's add this text to our function Get to know how to write and use functions in Google Sheets. Opens in new tab here. Text and, I think we only need one comma there. There we go.<br>12:23 So now let's add a few more.

Submit tickets. Ticket one. Submit. Ticket two. Submit.<br>12:35 Go back and see we have, ah, zeros until we have close, but this will be fine. We have some open tickets.<br>12:47 Now we need to create a dashboard Create dashboards to visualize and analyze your data effectively. Opens in new tab . We're just going to go through, we're not going to make this very easy, we're just going to go through some very simple formulas.<br>12:56 Open tickets. Say, total open tickets. Here. Average time to close. Okay, so here we need to figure out how many tickets are there that are not closed.<br>13:19 So we can do count if. And our criterion is that it's not closed.

You can also do count filter Learn how to filter data in Google Sheets for analysis. Opens in new tab .<br>13:36 I think we just actually want to say equals count all, b colon b will have an issue.<br>13:49 of tickets. And then we'll minus count if this is closed.<br>14:04 That gets us to perfect. That is our answer. But now, here's our average time to close.<br>14:17 How are we going to figure that out? Well, we can use the seam filter Learn how to filter data in Google Sheets for analysis. Opens in new tab . Or we can create a filter Understand how to create filters to manage your data. Opens in new tab .<br>14:25 We're going to filter Learn how to filter data in Google Sheets for analysis. Opens in new tab our time to close. And our condition Explore how to set conditions for data manipulation. Opens in new tab is that this is equal to closed. Let's take out the very first header row Learn about the significance of header rows in data organization. Opens in new tab .<br>14:37 So E2 and C2.

And we're going to average all of those. And there's our average. Let's see if that is correct because it's 177. Let's bring this back to reality.<br>14:56 There, 349. Dashboard Create dashboards to visualize and analyze your data effectively. Opens in new tab , and here's our average time to close. Perfect. So we've created a little bit of a dashboard Create dashboards to visualize and analyze your data effectively. Opens in new tab to get our information.<br>15:07 We've created our ticketing system here, where Understand the WHERE clause in Google Sheets queries. Opens in new tab we have an issue. We can add any number Explore how to work with numbers in Google Sheets. Opens in new tab of columns here that we want to get information from the Google Form Learn how to create and manage Google Forms for data collection. Opens in new tab .<br>15:17 We have a timestamp Understand how to use timestamps for tracking data changes. Opens in new tab when it's submitted. We have a closed drop-down menu that's added.

And our close time is automatically added when we click closed.<br>15:28 Our dashboard Create dashboards to visualize and analyze your data effectively. Opens in new tab shows total open tickets and average time to close. Pretty cool. Thanks for watching.</div>