Create Web App Report on Google Sheets using Google Apps Script

Поділитися
Вставка
  • Опубліковано 1 лис 2024

КОМЕНТАРІ • 66

  • @CodeWithCurt
    @CodeWithCurt  4 роки тому +3

    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:-

  • @leechinhhua
    @leechinhhua 3 роки тому

    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!

  • @DienNuocBaoLan
    @DienNuocBaoLan 3 роки тому

    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 !

  • @perrysantos
    @perrysantos 2 роки тому

    hi there, thanks for this :)
    may i ask how will i include pagination? i'm having a hard time incorporating. thanks

  • @newborn7850
    @newborn7850 4 роки тому +2

    M your big fan .. since the inception of your channel , but i alws miss ur code. pls put code in description

    • @reaganberganio
      @reaganberganio 4 роки тому +1

      Hi new born! See the code in my posted comment. :-)

    • @newborn7850
      @newborn7850 4 роки тому

      @@reaganberganio where?

    • @LuizFernando-ti1xx
      @LuizFernando-ti1xx 4 роки тому

      Hi@@newborn7850! Did you find the code?

    • @newborn7850
      @newborn7850 4 роки тому

      @@LuizFernando-ti1xx no bro

    • @CodeWithCurt
      @CodeWithCurt  4 роки тому

      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.

  • @lokeshandlokesh3136
    @lokeshandlokesh3136 3 роки тому

    Excellent sir, please make web app for POS/Normal billing using Google sheets. Thank you so much

  • @CodeWithCurt
    @CodeWithCurt  4 роки тому +2

    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

  • @EnteePeca
    @EnteePeca Рік тому

    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!

  • @namichand6445
    @namichand6445 3 роки тому

    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

  • @AKASHMANDAL2386
    @AKASHMANDAL2386 Рік тому

    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

  • @faiyazahemad6545
    @faiyazahemad6545 3 роки тому

    Your videos are excellent, but why are u not posting code in the description section rather in comment section

  • @luuminhvuong
    @luuminhvuong 4 роки тому +1

    Would be cool if with the web app u can edit something and save back to gg sheet

  • @sohaibroomi7404
    @sohaibroomi7404 3 роки тому

    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?

    • @namichand6445
      @namichand6445 3 роки тому

      its very easy just remove all filter in j query formula

  • @bumpersmith
    @bumpersmith 4 роки тому

    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.

    • @namichand6445
      @namichand6445 3 роки тому

      you can make it very simply by using select in place of inputs

  • @reaganberganio
    @reaganberganio 4 роки тому

    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)

    • @CodeWithCurt
      @CodeWithCurt  4 роки тому

      It looks to me that you don't have GetReport() JavaScript function declared. This would be located on your HTML page within the tags

    • @reaganberganio
      @reaganberganio 4 роки тому

      @@CodeWithCurt Thanks for the tutorial ! it's now working... :-)

  • @namichand6445
    @namichand6445 3 роки тому

    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

  • @persi8
    @persi8 4 роки тому

    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.

    • @CodeWithCurt
      @CodeWithCurt  4 роки тому

      In the comments section, try clicking on 'SORT BY' then clicking 'NEWEST FIRST' and see if they show up.

  • @rodolfoeduardo5488
    @rodolfoeduardo5488 11 місяців тому

    Thanks!

  • @slaheddinetrabelsi2391
    @slaheddinetrabelsi2391 3 роки тому

    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).

  • @minhvuongluu7644
    @minhvuongluu7644 4 роки тому

    Hi Curt, how scalable is this app ? like how many users can use this app at once time

    • @CodeWithCurt
      @CodeWithCurt  4 роки тому

      Not very scalable because you are using a google sheet to gather information before displaying in on the web app.

    • @minhvuongluu7644
      @minhvuongluu7644 4 роки тому

      @@CodeWithCurt I just want to display user data mainly

    • @namichand6445
      @namichand6445 3 роки тому

      @@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

  • @vinaysircsnip9526
    @vinaysircsnip9526 3 роки тому +1

    Hello Please the code.

  • @tazulislam2698
    @tazulislam2698 4 роки тому

    Bro, How to create summary on web page with google sheet data?

  • @deo2alliedgroup615
    @deo2alliedgroup615 3 роки тому

    SIR, Can we search using mobile no. ?

  • @giancarlomannucci9147
    @giancarlomannucci9147 4 роки тому

    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

    • @CodeWithCurt
      @CodeWithCurt  4 роки тому

      The parameters that are equal to A, B, and C are undefined. You need to declare those parameters.

    • @JNC_Edukasi
      @JNC_Edukasi 2 роки тому

      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 ;

  • @kholilurrhaman2024
    @kholilurrhaman2024 4 роки тому

    Like your videos

  • @kaushalkassi
    @kaushalkassi 2 роки тому

    From where i can get this code .

  • @sudeshprabhudesai2144
    @sudeshprabhudesai2144 4 роки тому

    Also table should be displayed only after entering Name and Roll.

  • @sudeshprabhudesai2144
    @sudeshprabhudesai2144 4 роки тому

    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:

    • @namichand6445
      @namichand6445 3 роки тому

      its simple you have to remove some inputs fields

    • @JNC_Edukasi
      @JNC_Edukasi 2 роки тому

      To position center:
      Name:
      ROLL:
      RESULT:

  • @k1unriyo694
    @k1unriyo694 4 роки тому

    why this app can't open in android?

  • @oscarhidalgorojas494
    @oscarhidalgorojas494 4 роки тому

    How can i get the code ? good afternoon !

    • @CodeWithCurt
      @CodeWithCurt  4 роки тому +1

      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.

    • @oscarhidalgorojas494
      @oscarhidalgorojas494 4 роки тому

      @@CodeWithCurt are both the code.gs and webapps??

  • @sudeshprabhudesai2144
    @sudeshprabhudesai2144 4 роки тому

    I am getting things on webpage ,but table says error,undefined,undefined

    • @nunovaz829
      @nunovaz829 4 роки тому

      Same here :(

    • @rachmatsidik8233
      @rachmatsidik8233 3 роки тому

      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

    • @cognitolesprivat7968
      @cognitolesprivat7968 3 роки тому

      @@rachmatsidik8233 joss om..

  • @onlineadmissionform3001
    @onlineadmissionform3001 3 роки тому

    give the code

  • @sudeshprabhudesai2144
    @sudeshprabhudesai2144 4 роки тому

    AFTER I PUT VALUES IN BOXEX AND SUBMIT BUTTON

    • @CodeWithCurt
      @CodeWithCurt  4 роки тому

      I posted the Google Apps Script Code in the Comments. I hope this helps.

    • @sudeshprabhudesai2144
      @sudeshprabhudesai2144 4 роки тому

      @@CodeWithCurt Thank you so much.It works

    • @sumitranagaraj4783
      @sumitranagaraj4783 4 роки тому

      @@CodeWithCurt Hi.. can you post the script again..

    • @CodeWithCurt
      @CodeWithCurt  4 роки тому

      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.

  • @newborn7850
    @newborn7850 4 роки тому

    pls reply with code

    • @CodeWithCurt
      @CodeWithCurt  4 роки тому

      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.

    • @newborn7850
      @newborn7850 4 роки тому

      @@CodeWithCurt does not work ,,, no comments from now