Create Web App Report on Google Sheets using Google Apps Script

Поделиться
HTML-код
  • Опубликовано: 15 сен 2024

Комментарии • 66

  • @CodeWithCurt
    @CodeWithCurt  4 года назад +2

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

  • @DienNuocBaoLan
    @DienNuocBaoLan 2 года назад

    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 !

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

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

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

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

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

  • @lokeshandlokesh3136
    @lokeshandlokesh3136 3 года назад

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

  • @perrysantos
    @perrysantos 2 года назад

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

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

  • @luuminhvuong
    @luuminhvuong 4 года назад +1

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

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

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

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

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

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

  • @giancarlomannucci9147
    @giancarlomannucci9147 3 года назад

    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  3 года назад

      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 ;

  • @tazulislam2698
    @tazulislam2698 3 года назад

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

  • @kaushalkassi
    @kaushalkassi 2 года назад

    From where i can get this code .

  • @rodolfoeduardo5488
    @rodolfoeduardo5488 10 месяцев назад

    Thanks!

  • @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... :-)

  • @deo2alliedgroup615
    @deo2alliedgroup615 3 года назад

    SIR, Can we search using mobile no. ?

  • @vinaysircsnip9526
    @vinaysircsnip9526 3 года назад +1

    Hello Please the code.

  • @k1unriyo694
    @k1unriyo694 3 года назад

    why this app can't open in android?

  • @sudeshprabhudesai2144
    @sudeshprabhudesai2144 4 года назад

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

  • @minhvuongluu7644
    @minhvuongluu7644 4 года назад

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

    • @CodeWithCurt
      @CodeWithCurt  3 года назад

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

    • @minhvuongluu7644
      @minhvuongluu7644 3 года назад

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

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

  • @faiyazahemad6545
    @faiyazahemad6545 3 года назад

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

  • @kholilurrhaman2024
    @kholilurrhaman2024 4 года назад

    Like your videos

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

  • @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 года назад

    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.

  • @onlineadmissionform3001
    @onlineadmissionform3001 3 года назад

    give the code

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