What is the use of functional tool extension here ?? Yeah noticed the error.. i am in mobile
Remove the extension and try(no need)
Sorry, see this mistake (start value place is missing)
What is the use of functional tool extension here ?? Yeah noticed the error.. i am in mobile
Remove the extension and try(no need)
Sorry, see this mistake (start value place is missing)
yess u’r rightt.. hehehe.. i’m forget
“I am having another idea but based on the script code only… there by you can do it. No need to send data only logout .”
BTW, how to do this?
In the addRow function just modify code like thsi,
return ContentService.createTextOutput(lr);
So after creating row in the web got text it will return the index number,
With this number use writeCell funtion to write in the loggout time
Got it??? @Yudistira
Correct… After creating row , in the web got text use one variable to catch the return.. just try now
So this will vary.. see if same person logged in and out multiple times, then your calling method won’t be work.. actually you need, the person who writes in the row . Whoever may write any number. of times..
Imagine if the ID 8888 logged in atleast two times then as per your block it will return to the first value only. It won’t return second last item..
Understand my point?
Can you share us with what you have did?
var ss = SpreadsheetApp.openByUrl("Link Google Sheet");
var sheet = ss.getSheetByName("Name Sheet");
function doGet(e){
var action = e.parameter.action;
if(action == "in")
return inTime(e);
if(action == "out")
return outTime(e);
}
function doPost(e){
var action = e.parameter.action;
if(action == "in")
return inTime(e);
if(action == "out")
return outTime(e);
}
function inTime(e){
var id = e.parameter.id;
var values = sheet.getRange(2,2,sheet.getLastRow(),1).getValues();
for(var i = 0 ; i<values.length ; i++){
if(values[i][0] == id){
i=i+2;
var in_time = Utilities.formatDate(new Date(), "GMT+7", "HH:mm:ss");
sheet.getRange(i,3).setValue(in_time);
return ContentService.createTextOutput("Thank You ! Your In Time is "+in_time).setMimeType(ContentService.MimeType.TEXT);
}
}
return ContentService.createTextOutput("Id Not Found").setMimeType(ContentService.MimeType.TEXT);
}
function outTime(e){
var id = e.parameter.id;
var values = sheet.getRange(2,2,sheet.getLastRow(),1).getValues();
for(var i = 0 ; i<values.length ; i++){
if(values[i][0] == id){
i=i+2;
var out_time = Utilities.formatDate(new Date(), "GMT+7", "HH:mm:ss");
sheet.getRange(i,5).setValue(out_time);
return ContentService.createTextOutput("Thank You ! Your Out Time is "+out_time).setMimeType(ContentService.MimeType.TEXT);
}
}
return ContentService.createTextOutput("Id Not Found").setMimeType(ContentService.MimeType.TEXT);
}
i use this script.. for index no unique , random 1 - 9999999
I have a little problem, when I login and enter screen2 (dashboard).. then I logout and enter screen1 again.. well the problem is when I want to exit with the back button .. my application returns to screen2 (dashboard) … what because of tinyDb ?
While you logout time , you no need to redirect here, I mean screen1.. else automatically you will be redirected to dashboard.
Just use proper way of closing screens in logout screen. Or you must use one more tinydb here(but it does not needed)
No… This is not correct way.
It seems you are closing the current screen.if so where do you want to redirect ?
Want to close the screen or close app or want to do both?
from screen2 (dashboard) to screen1
Best advise is do not use screen redirection in screen initialise event.. use it on when button/any other component click event. (To avoid loop)
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.