Google Apps Script Code used in Video Below: function doGet(e) { return HtmlService.createHtmlOutputFromFile('TimeTracker'); } function getEmployees() { var ss= SpreadsheetApp.getActiveSpreadsheet(); var employeeSheet = ss.getSheetByName("EMPLOYEES"); var getLastRow = employeeSheet.getLastRow(); return employeeSheet.getRange(2, 1, getLastRow - 1, 1).getValues(); } function clockIn(employee) {
//DEFINE ALL ACTIVE SHEETS var ss = SpreadsheetApp.getActiveSpreadsheet();
//DEFINE MAIN SHEET var mainSheet = ss.getSheetByName("MAIN"); //LAST ROW ON MAIN SHEET var lastRow = mainSheet.getLastRow();
//Define Return Variables var return_date = ''; var error = 'SUCCESS'; var return_array = []; for (var j = 2; j 12) ? addZero(currentDate.getHours()) - 12 : addZero(currentDate.getHours()); var currentMinutes = addZero(currentDate.getMinutes()); var currentSeconds = addZero(currentDate.getSeconds()); var suffix = (addZero(currentDate.getHours()) >= 12)? 'PM' : 'AM'; var date = currentMonth.toString() + '/' + currentDate.getDate().toString() + '/' + currentYear.toString() + ' ' + currentHours.toString() + ':' + currentMinutes.toString() + ':' + currentSeconds.toString() + ' ' + suffix;
return date; } function clockOut(employee) {
//DEFINE ALL ACTIVE SHEETS var ss = SpreadsheetApp.getActiveSpreadsheet();
//DEFINE MAIN SHEET var mainSheet = ss.getSheetByName("MAIN"); //LAST ROW ON MAIN SHEET var lastRow = mainSheet.getLastRow();
var foundRecord = false;
var new_date = new Date(); var return_date = getDate(new_date); var error = 'SUCCESS'; var return_array = [];
Thank you so much. It took me a few hours to personalize it as I wanted but I was able to add the break in and Out options and update it to the Sheet. You're amazing!
This has been so helpful :) Thank you. I have a question, there are times the onClick action take little time load, how can we add a loading spinner to this code?
Awesome work my man, and thanks for the code! Do you have paid services? I was looking to input a description of what was accomplished for the day as well. Thanks again, and I look forward to hearing from you.
Excellent job! I was wondering if I can add a comments box under the employee dropdown box. Is this possible? If so, what I will need to change on the script?
Hi Curt, Well done. May i have your advice? Name in list can do Check In/Out for each other (Steve clock in/out for Jim). How to track or prevent this? or we just do clock in/out only person logged in to this sheet?
if you havenot fix it yet. replace selection with input in your HTML inside your input specify if you want people to enter name or id-number. no one will chech-in or out anybody else.
Thank you for sharing great content, but I have one question, why is this web app not running in the safari when I scan the QR code? It redirects me to the google drive page means no page found page. I am having a problem with only the iPhone safari. It can run in crome correct.
If I wanted to add a text field under the employee area so that they could enter a note that gets written to the google sheet on clock in. How would I go about doing that by chance?
Can I make one simple modification. Employee uses a time stamped, GPS photo at the start and end of shift. Then the time is validated off of the time stamp text in the photo.
Is there a way to set this up by payroll? For example, my employees get paid the 10th and 25th of the month. The 10th payroll covers the 16-end of prior month and the 25th covers the 1-15 of current month. If so, can you guide me with the script on how to set this up? Thanks.
Hello, Thank you for the code and the explanation. Is there a formula I could use that would separate the date and the time of clocking in and clocking out?
hi Code With Curt firt to all, thx for the all video there are useful to me! , i have 1 question, its possible take a phote of employee when fill the form? and save this data on sheet?
Hi Curt! I loved it! I have 1 concern, where to add another drop down for activities? I added it but it's not showing when published. Thanks in advance for your answer.
Hi, In the video the Hours are added up on the right side, but in my case it just adds it next to it. (Example: 0.01 and 0.02 are the two thing i want to add up, what i want as a result: 0.03 only so i got 0.010.02). Can somebody help me?
Hi please help.. I have added new drop-down in html but data not updated in the gsheet. I have try all the possibilities but did not get solution Please help on this.
I am using google script to download all sheets in pdf, but I need to add some time during running, because to convert the url to pdf takes to much time and I got the error 429, if you can help me would be great.
Sir, how can we put verification or password for each EMPLOYEE in order to avoid unauthorized clocked in and clocked out.. to prevent, example employee A from clock outing employee B.
What would I need to change on the script if I wanted to add an additional sheet so when the employee is clocking in and out they can also select a location that the were working at?
You would need to add a google sheet of locations. Create a dropdown on the HTML page and add a function similar to getEmployees() to fill the locations dropdown with locations. Then on the clockIn() function you would need to carry the location selected.
@@CodeWithCurt I can get the drop down of locations to work but I can't get the clock in and out function to work and my locations are not showing up on the main sheet.
Curt, I do not know what I'm doing but I followed your steps and have a working TimeTracker. Is it only possible to use if the computer is logged in to the admins account? I sent the app link to someone else with their own gmail to view the app but they have their own gmail and couldn't view the app.
Make sure you share the link that ends in 'exec'. The one that is under 'Current Web App URL'. When deploying the web app make sure to change 'Who has access to the app' to everyone. Let me know if that helps.
If you have trouble finding the code in the comments try this: -In the comments section, try clicking on 'SORT BY' then clicking 'NEWEST FIRST' and see if they show up.
If you have trouble finding the code in the comments try this: -In the comments section, try clicking on 'SORT BY' then clicking 'NEWEST FIRST' and see if they show up.
Hi, I am trying to add an extra column, "reason". I manage to get it displayed but the reason input does not get reflected in my google sheet, why is it so?
@@bryanstockton5934 I added a comment box as well as an additional dropdown for 'location' to show where employee worked. I can see the list of locations on the spread sheet reflected in the web apps drowdown options but I am unsure how to populate MAIN with the additional option of 'location and 'comments'. Could you help?
Google Apps Script Code used in Video Below:
function doGet(e) {
return HtmlService.createHtmlOutputFromFile('TimeTracker');
}
function getEmployees() {
var ss= SpreadsheetApp.getActiveSpreadsheet();
var employeeSheet = ss.getSheetByName("EMPLOYEES");
var getLastRow = employeeSheet.getLastRow();
return employeeSheet.getRange(2, 1, getLastRow - 1, 1).getValues();
}
function clockIn(employee) {
//DEFINE ALL ACTIVE SHEETS
var ss = SpreadsheetApp.getActiveSpreadsheet();
//DEFINE MAIN SHEET
var mainSheet = ss.getSheetByName("MAIN");
//LAST ROW ON MAIN SHEET
var lastRow = mainSheet.getLastRow();
//Define Return Variables
var return_date = '';
var error = 'SUCCESS';
var return_array = [];
for (var j = 2; j 12) ? addZero(currentDate.getHours()) - 12 : addZero(currentDate.getHours());
var currentMinutes = addZero(currentDate.getMinutes());
var currentSeconds = addZero(currentDate.getSeconds());
var suffix = (addZero(currentDate.getHours()) >= 12)? 'PM' : 'AM';
var date = currentMonth.toString() + '/' + currentDate.getDate().toString() + '/' +
currentYear.toString() + ' ' + currentHours.toString() + ':' +
currentMinutes.toString() + ':' + currentSeconds.toString() + ' ' + suffix;
return date;
}
function clockOut(employee) {
//DEFINE ALL ACTIVE SHEETS
var ss = SpreadsheetApp.getActiveSpreadsheet();
//DEFINE MAIN SHEET
var mainSheet = ss.getSheetByName("MAIN");
//LAST ROW ON MAIN SHEET
var lastRow = mainSheet.getLastRow();
var foundRecord = false;
var new_date = new Date();
var return_date = getDate(new_date);
var error = 'SUCCESS';
var return_array = [];
for (var j = 2; j
Thank you
Mob
Yrsf
@@อ่านหน่อยหนังสือ ดีๆ
.
Thank you so much. It took me a few hours to personalize it as I wanted but I was able to add the break in and Out options and update it to the Sheet. You're amazing!
HTML, Javascript, Jquery, and Bootstrap Code used in Video:
$( document ).ready(function() {
getEmployees();
});
function getEmployees()
{
google.script.run.withSuccessHandler(function(ar)
{
var employeeSelect = document.getElementById("employee");
console.log(ar);
let option = document.createElement("option");
option.value = "";
option.text = "";
employeeSelect.appendChild(option);
ar.forEach(function(item, index)
{
let option = document.createElement("option");
var employee = item[0];
option.value = item[0];
option.text = item[0];
employeeSelect.appendChild(option);
});
}).getEmployees();
};
function ClockIn()
{
$('#message').html("");
var employee = document.getElementById("employee").value;
if(employee != '')
{
google.script.run.withSuccessHandler(function(ar)
{
console.log(ar);
ar.forEach(function(item, index)
{
if(item[0] == 'SUCCESS')
{
var message = item[2] + ' Clocked in at ' + item[1];
$('#message').html(message);
document.getElementById("message").className = "alert alert-primary";
}
else
{
var message = item[2] + ' ' + item[0];
$('#message').html(message);
document.getElementById("message").className = "alert alert-warning";
}
});
}).clockIn(employee);
}
}
function ClockOut()
{
$('#message').html("");
var employee = document.getElementById("employee").value;
if(employee != '')
{
google.script.run.withSuccessHandler(function(ar)
{
console.log(ar);
ar.forEach(function(item, index)
{
if(item[0] == 'SUCCESS')
{
var message = item[2] + ' Clocked out at ' + item[1];
$('#message').html(message);
document.getElementById("message").className = "alert alert-primary";
}
else
{
var message = item[2] + ' ' + item[0];
$('#message').html(message);
document.getElementById("message").className = "alert alert-warning";
}
});
}).clockOut(employee);
}
}
Time Tracker
Employee
Thanks
เยี่ยม.
ัร
thanks
This has been so helpful :) Thank you. I have a question, there are times the onClick action take little time load, how can we add a loading spinner to this code?
Hi Curt,I would like to ask if how can I add more option other than "Clock In" and " Clock Out" ? I'd like to add " Second Shift" on my web app ?
The code please.. i tried to look for the script as you sait to check the comments for the code but i can't see it
I have 2 questions.
1.How can I like Google sheet with the Apps script?
2.Is it possible to fix location's IP address to checkin/out?
I’d like to know # 2 as well
Me too waiting for this.
how to get code for employee time clock google apps script
Awesome work my man, and thanks for the code! Do you have paid services? I was looking to input a description of what was accomplished for the day as well. Thanks again, and I look forward to hearing from you.
Thank you so much this was so helpful you are AWESOME !!!
Hi Curt, it's very useful product but I have one question how can we make username and password for everyone
Excellent job! I was wondering if I can add a comments box under the employee dropdown box. Is this possible? If so, what I will need to change on the script?
Hi Curt, Well done.
May i have your advice? Name in list can do Check In/Out for each other (Steve clock in/out for Jim). How to track or prevent this? or we just do clock in/out only person logged in to this sheet?
if you havenot fix it yet. replace selection with input in your HTML
inside your input specify if you want people to enter name or id-number. no one will chech-in or out anybody else.
Thank you so much for this! Youre a blessing!
how can i change the hour form so it don't show 0.06 for example
Thank you for sharing great content, but I have one question, why is this web app not running in the safari when I scan the QR code? It redirects me to the google drive page means no page found page. I am having a problem with only the iPhone safari. It can run in crome correct.
*Sir please give me all Script codes i am waiting. THANKS*
If I wanted to add a text field under the employee area so that they could enter a note that gets written to the google sheet on clock in. How would I go about doing that by chance?
Can I make one simple modification. Employee uses a time stamped, GPS photo at the start and end of shift. Then the time is validated off of the time stamp text in the photo.
Is there a way to set this up by payroll? For example, my employees get paid the 10th and 25th of the month. The 10th payroll covers the 16-end of prior month and the 25th covers the 1-15 of current month. If so, can you guide me with the script on how to set this up? Thanks.
Hello,
Thank you for the code and the explanation. Is there a formula I could use that would separate the date and the time of clocking in and clocking out?
Try =ARRAYFORMULA(IFS(ROW(B:B)=1,"TimeStamped Date",B:B="","",True,DATEVALUE(B:B))) where B is the timestamp
hi Code With Curt firt to all, thx for the all video there are useful to me! , i have 1 question, its possible take a phote of employee when fill the form? and save this data on sheet?
Thanks for the code ,it is possible to have a code generator each day before employee clock in every day.Thanks
Hi Curt! I loved it! I have 1 concern, where to add another drop down for activities? I added it but it's not showing when published. Thanks in advance for your answer.
When deploying the Web App you may to to version it up a number to see the changes.
@@CodeWithCurt thank you
Hi, In the video the Hours are added up on the right side, but in my case it just adds it next to it. (Example: 0.01 and 0.02 are the two thing i want to add up, what i want as a result: 0.03 only so i got 0.010.02).
Can somebody help me?
Hey Curt, please kindly point me in the direction where the time-zone can be set?
I'm in the UK and currently the time is reporting as from the US.
You can change the TZ on the spreadsheet by going to File> Spreadsheet settings
Thank you for sharing! It is GREAT!
What will I need to change or add on the script to have a start break and end break option
lol seems easy at thie first view then getting in the code script get interesting . nice freaking job
If I want to use this for volunteers instead of employees, would I just replace the word "employee" with "volunteer" in the coding?
Hi Curt, this is a good job you have done here. I'm unable to see the scripts in the comment section. Do you mind sharing?
I've tracked and found the scripts. Thanks
Hi please help.. I have added new drop-down in html but data not updated in the gsheet. I have try all the possibilities but did not get solution Please help on this.
Thanks for sharing your great work. would you please share how to add a password for each name. Otherwise anyone can log in for other's name .
I am using google script to download all sheets in pdf, but I need to add some time during running, because to convert the url to pdf takes to much time and I got the error 429, if you can help me would be great.
This is perfectly working. Thankyou so much!!!
hi how find code scrip code.gs and html pls help me
i want a googlesheet to remove a top row after every one hour , how to do this
Cannot clock in or out with the codes
where can I copy codes for time tacker?
How can I put add photo upload for this and seperate link for every employee
The code please.
script please it is not showing in newest first can u give us link of github repository
that's very Impressive I've been looking for this for a week now, is there any option to add a password per each name ?
Great ! I also want to know if it is possible to add a password for each name. Otherwise anyone can log in for anyone's name .
how did you copy google app scribt code plz
Is there something that include breaks
Great Job!
how can i delete the employee from the selection after the submit?
how can I change a time when an employee has made a mistake?
You can make the corrections directly on the google sheet.
how to clock in using the google maps location
Can I have the code please? Thank you.
Sir, how can we put verification or password for each EMPLOYEE in order to avoid unauthorized clocked in and clocked out.. to prevent, example employee A from clock outing employee B.
Hello did you figure out how to add verification code?? im also looking to add it ! please let me know
Do you have answers?
@@MrRaulcaviedes give uniqueID to each along with name and validate it when they click clock in
Hey Curt,
Everything works, except it did not total it on the right side. How can I fix this?
I had the same problem. But after found out. Try to add more decimal digits from the above menu. then it gets resolved. Cheers
Thanks for your code; can we link it to a user form?
What would I need to change on the script if I wanted to add an additional sheet so when the employee is clocking in and out they can also select a location that the were working at?
You would need to add a google sheet of locations. Create a dropdown on the HTML page and add a function similar to getEmployees() to fill the locations dropdown with locations. Then on the clockIn() function you would need to carry the location selected.
@@CodeWithCurt I can get the drop down of locations to work but I can't get the clock in and out function to work and my locations are not showing up on the main sheet.
@@traceywilliams-esc7905 I am having this same issue. did you ever figure it out?
@@traceywilliams-esc7905 do you get solution so please help me
@@24jdcspecialtytreatmentcou22 do you get solution so please help me
Curt,
I do not know what I'm doing but I followed your steps and have a working TimeTracker. Is it only possible to use if the computer is logged in to the admins account? I sent the app link to someone else with their own gmail to view the app but they have their own gmail and couldn't view the app.
Make sure you share the link that ends in 'exec'. The one that is under 'Current Web App URL'. When deploying the web app make sure to change 'Who has access to the app' to everyone. Let me know if that helps.
@@CodeWithCurt didn't get the code
what if i want to add input locator ? please help me.
Thanks for the code but i have error like this
Is the name of the HTML file called 'TimeTracker'? Either it isn't the same name or it doesn't exist.
Hello where is the link for the scrit
If you have trouble finding the code in the comments try this:
-In the comments section, try clicking on 'SORT BY' then clicking 'NEWEST FIRST' and see if they show up.
Hi, I'm from Malaysia. How to change time to my country at clock in and clock out?
Dekat Google script profile tu tukar Asia/Kuala_Lumpur
Thank you sir your video is really helpful.
can you share me link for script
HELLO WHERE IS THE LINK FOR THE SCRIPT?
The script is in the comments of the video. I may have said link in the video but I meant to say in the comments of the video. Sorry.
@@CodeWithCurt the comment section only shows the libhrary reference
If you have trouble finding the code in the comments try this:
-In the comments section, try clicking on 'SORT BY' then clicking 'NEWEST FIRST' and see if they show up.
hi code with curt pls help me for script
link for script ?
The script is in the comments of the video. I may have said link in the video but I meant to say in the comments of the video. Sorry.
thank you so much!
whole code please
kh3vin14@gmail.com
All the code is given in the comments below the video. All that needs to be setup is the google sheet.
@@CodeWithCurt the codes for hours and total hours, wrong coding for duration
Hi, I am trying to add an extra column, "reason". I manage to get it displayed but the reason input does not get reflected in my google sheet, why is it so?
Ff
I would like to know how to add a comment box. Can you help me, please?
@@bryanstockton5934 I added a comment box as well as an additional dropdown for 'location' to show where employee worked. I can see the list of locations on the spread sheet reflected in the web apps drowdown options but I am unsure how to populate MAIN with the additional option of 'location
and 'comments'. Could you help?
@@bryanstockton5934 no, I haven't can you help me, please.
@@24jdcspecialtytreatmentcou22
do you get solution so please help me
@@bryanstockton5934 Guys do you get solution so please help me
@@bryanstockton5934 can you please help
Why getmonth is showing "undefined"?
NEWEST FIRST
Works Well :)
thanks
Newest first
plz send me a google sheet for this
pulkitdhir54@gmail.com
newest first
Nice.
interest
sort by
SORT BY
Sort by
NEWEST FIRST
Newest first
SORT BY