function GetReport() { var type = document.getElementById("type").value; var color = document.getElementById("color").value; var height1 = document.getElementById("height1").value; var height2 = document.getElementById("height2").value;
Google Apps Script Used in Video Below: function doGet(e) { return HtmlService.createHtmlOutputFromFile('WebApp'); } function getResultsSQL(type, color, height1, height2){ var url = ''; //Paste URL of GOOGLE SHEET var ss= SpreadsheetApp.openByUrl(url); var webAppSheet2 = ss.getSheetByName("Sheet2"); var webAppSheet1 = ss.getSheetByName("Sheet1"); var sqlStatement = 'select A, B, C where 1 = 1 ';
if(type != '') { sqlStatement += " and A = '"+type+"' "; } if(color != '') { sqlStatement += " and B = '"+color+"' "; } if(height1 != '') { if(height2 == '') { height2 = height1; }
But this method works when single users work..if multiple user use same interface simultaneously then may be result vary..any suggestion to get rid of this issue
This is brilliant, and really helpful, thank you! One thing I've been trying to do, which is probably really simple, is to get some text from a Google Doc, and for it to display on a site using Google web app script. The reason I want to do this, is because I want to make a site, that I share with people, but I want them to be able to update the text themselves without having to go into the code. When I do it, it puts all the text into one long line. Do you have to pull all the paragraphs and populate an array, then output them individually? Or is there a simpler way to do this? Thanks!
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 @Curt, I find your tutorials very informative. But I need to import specific Data row from Google sheet on the basis of ID which is entered in WebApp Dialog box by user. Can you please guide me?
Thanks for this super_tutorial. Just I find a problem when I invite someone to check records with this app, he can't do it except when I share with him the original google sheets with editor access (with viewer authorization he can't get any result).
Again another unique concept of creating the Query function as a string and sending it back to Sheets. This concept would have been much more usable if the user would have been presented with a dropdown list showing the choices and then another dropdown showing the options for the colors available for the chosen type.
I get this error on sheet 2, how can I correct it? =QUERY(Hoja1!A1:C11,"select A, B, C where 1 = 1 and A = 'undefined' and B = 'undefined' and C >= undefined and C
Look carefully at your parameters. For example; Mr.Curt using =QUERY(Sheets1!A1:C11,"...we found error, change it to =QUERY(Sheets1!A1:C11;"..Look at parameter after C11.Using , or ;
Hi Curt! What is the fix for this error? thanks Uncaught SyntaxError: Invalid or unexpected token 2userCodeAppPanel:1 Uncaught ReferenceError: GetReport is not defined at HTMLInputElement.onclick (userCodeAppPanel:1)
@@minhvuongluu7644 i also want this like you but this thing only works when a low number of users are on the web app if a number of users using this at a same time this thing not gonna work
I have altered your code for my need.But I want to enter only Name and Roll in the web boxes and table should appear.I dont want Result box on web page. Also everything including Table should come to the centre. Kindly advise.
M.E.S. HIGHER SECONDARY Results of A.E.T. for the year 2020-21
function GetReport() { var name = document.getElementById("name").value; var roll = document.getElementById("roll").value; var result = document.getElementById("result").value;
Try to change comma to semicolon in your GoogleScript file while declaring variable query after table range : var query = '=QUERY('+tableRange+';\"'+sqlStatement+'\")'; Curt code using comma : var query = '=QUERY('+tableRange+',\"'+sqlStatement+'\")'; I think perhaps for non IOS user the google sheet query formula must use semicolon
The code is posted in the comments below the video. 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.
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.
HTML and Javascript in Video:
function GetReport()
{
var type = document.getElementById("type").value;
var color = document.getElementById("color").value;
var height1 = document.getElementById("height1").value;
var height2 = document.getElementById("height2").value;
google.script.run.withSuccessHandler(function(ar)
{
console.log(ar);
var displayTable = '';
displayTable = '';
ar.forEach(function(item, index)
{
if(index == 0)
{
displayTable += "";
displayTable += ""+item[0]+"";
displayTable += ""+item[1]+"";
displayTable += ""+item[2]+"";
displayTable += "";
}
else
{
displayTable += "";
displayTable += ""+item[0]+"";
displayTable += ""+item[1]+"";
displayTable += ""+item[2]+"";
displayTable += "";
}
});
displayTable += '';
document.getElementById("dispalyTableHere").innerHTML = displayTable;
}).getResultsSQL(type, color, height1, height2);
}
Type:
Color:
Height:-
Cảm ơn Bạn rất nhiều, tôi đã thực hiện theo các bước bạn hướng dẫn và đã thành công !
Google Apps Script Used in Video Below:
function doGet(e) {
return HtmlService.createHtmlOutputFromFile('WebApp');
}
function getResultsSQL(type, color, height1, height2){
var url = ''; //Paste URL of GOOGLE SHEET
var ss= SpreadsheetApp.openByUrl(url);
var webAppSheet2 = ss.getSheetByName("Sheet2");
var webAppSheet1 = ss.getSheetByName("Sheet1");
var sqlStatement = 'select A, B, C where 1 = 1 ';
if(type != '')
{
sqlStatement += " and A = '"+type+"' ";
}
if(color != '')
{
sqlStatement += " and B = '"+color+"' ";
}
if(height1 != '')
{
if(height2 == '')
{
height2 = height1;
}
sqlStatement += " and C >= "+height1+" and C
Thanks
But this method works when single users work..if multiple user use same interface simultaneously then may be result vary..any suggestion to get rid of this issue
Hi, been trying to make this work. I just need 1 search field to match to a single column and output the data row please help!
This is brilliant, and really helpful, thank you! One thing I've been trying to do, which is probably really simple, is to get some text from a Google Doc, and for it to display on a site using Google web app script. The reason I want to do this, is because I want to make a site, that I share with people, but I want them to be able to update the text themselves without having to go into the code. When I do it, it puts all the text into one long line. Do you have to pull all the paragraphs and populate an array, then output them individually? Or is there a simpler way to do this? Thanks!
Hi curt
If I Clicked On Submit Button If there is nothing In the Input feilds it bring whole table to web app
Which is unwanted
Please help me
Excellent sir, please make web app for POS/Normal billing using Google sheets. Thank you so much
hi there, thanks for this :)
may i ask how will i include pagination? i'm having a hard time incorporating. thanks
hi i am working on a project using your help now i want to show length of data fetched after click so i can show this to user please help me
Would be cool if with the web app u can edit something and save back to gg sheet
M your big fan .. since the inception of your channel , but i alws miss ur code. pls put code in description
Hi new born! See the code in my posted comment. :-)
@@reaganberganio where?
Hi@@newborn7850! Did you find the code?
@@LuizFernando-ti1xx no bro
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 @Curt, I find your tutorials very informative. But I need to import specific Data row from Google sheet on the basis of ID which is entered in WebApp Dialog box by user. Can you please guide me?
its very easy just remove all filter in j query formula
Thanks for this super_tutorial. Just I find a problem when I invite someone to check records with this app, he can't do it except when I share with him the original google sheets with editor access (with viewer authorization he can't get any result).
Hi, where Ican find the code? I cannot see it and You mentioned it is somewhere in the posted comment. Thanks in advance for helping me.
In the comments section, try clicking on 'SORT BY' then clicking 'NEWEST FIRST' and see if they show up.
Again another unique concept of creating the Query function as a string and sending it back to Sheets.
This concept would have been much more usable if the user would have been presented with a dropdown list showing the choices and then another dropdown showing the options for the colors available for the chosen type.
you can make it very simply by using select in place of inputs
I get this error on sheet 2, how can I correct it?
=QUERY(Hoja1!A1:C11,"select A, B, C where 1 = 1 and A = 'undefined' and B = 'undefined' and C >= undefined and C
The parameters that are equal to A, B, and C are undefined. You need to declare those parameters.
Look carefully at your parameters. For example; Mr.Curt using =QUERY(Sheets1!A1:C11,"...we found error, change it to =QUERY(Sheets1!A1:C11;"..Look at parameter after C11.Using , or ;
Bro, How to create summary on web page with google sheet data?
From where i can get this code .
Thanks!
Hi Curt! What is the fix for this error? thanks
Uncaught SyntaxError: Invalid or unexpected token
2userCodeAppPanel:1 Uncaught ReferenceError: GetReport is not defined
at HTMLInputElement.onclick (userCodeAppPanel:1)
It looks to me that you don't have GetReport() JavaScript function declared. This would be located on your HTML page within the tags
@@CodeWithCurt Thanks for the tutorial ! it's now working... :-)
SIR, Can we search using mobile no. ?
Hello Please the code.
why this app can't open in android?
Also table should be displayed only after entering Name and Roll.
Hi Curt, how scalable is this app ? like how many users can use this app at once time
Not very scalable because you are using a google sheet to gather information before displaying in on the web app.
@@CodeWithCurt I just want to display user data mainly
@@minhvuongluu7644 i also want this like you but this thing only works when a low number of users are on the web app if a number of users using this at a same time this thing not gonna work
I have altered your code for my need.But I want to enter only Name and Roll in the web boxes and table should appear.I dont want Result box on web page. Also everything including Table should come to the centre. Kindly advise.
M.E.S. HIGHER SECONDARY
Results of A.E.T. for the year 2020-21
function GetReport()
{
var name = document.getElementById("name").value;
var roll = document.getElementById("roll").value;
var result = document.getElementById("result").value;
google.script.run.withSuccessHandler(function(ar)
{
console.log(ar);
var displayTable = '';
displayTable = '';
ar.forEach(function(item, index)
{
if(index == 0)
{
displayTable += "";
displayTable += ""+item[0]+"";
displayTable += ""+item[1]+"";
displayTable += ""+item[2]+"";
displayTable += "";
}
else
{
displayTable += "";
displayTable += ""+item[0]+"";
displayTable += ""+item[1]+"";
displayTable += ""+item[2]+"";
displayTable += "";
}
});
displayTable += '';
document.getElementById("dispalyTableHere").innerHTML = displayTable;
}).getResultsSQL(name, roll, result);
}
Name:
ROLL:
RESULT:
its simple you have to remove some inputs fields
To position center:
Name:
ROLL:
RESULT:
Your videos are excellent, but why are u not posting code in the description section rather in comment section
Like your videos
I am getting things on webpage ,but table says error,undefined,undefined
Same here :(
Try to change comma to semicolon in your GoogleScript file while declaring variable query after table range : var query = '=QUERY('+tableRange+';\"'+sqlStatement+'\")';
Curt code using comma : var query = '=QUERY('+tableRange+',\"'+sqlStatement+'\")';
I think perhaps for non IOS user the google sheet query formula must use semicolon
@@rachmatsidik8233 joss om..
How can i get the code ? good afternoon !
The code is posted in the comments below the video.
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.
@@CodeWithCurt are both the code.gs and webapps??
AFTER I PUT VALUES IN BOXEX AND SUBMIT BUTTON
I posted the Google Apps Script Code in the Comments. I hope this helps.
@@CodeWithCurt Thank you so much.It works
@@CodeWithCurt Hi.. can you post the script again..
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.
give the code
pls reply with code
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.
@@CodeWithCurt does not work ,,, no comments from now