Create an Input Sheet with a Submit Button in Google Sheets to add Data to a Log: Apps Script part 2

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

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

  • @zpressley
    @zpressley Год назад +1

    This is awesome, using this script to build a fantasy baseball trade app. Clicking the button submits the trade to manager then that manager can accept the trade. Amazing

    • @yagisanatode
      @yagisanatode  Год назад

      That is an awesome use case. You would be surprised about how many fantasy sports enthusiasts use my code snippets. Always great folks.

  • @ceepee9826
    @ceepee9826 Год назад +5

    Perfect!
    But is there a way to have data transferred to a specific row/column instead of all below each other?

    • @GoldnRule
      @GoldnRule Год назад

      This pleasee. We need this option

  • @ova1tine-tasty305
    @ova1tine-tasty305 Год назад +1

    Thank you! This video helped me a lot.

  • @Aden-wu5zp
    @Aden-wu5zp 9 месяцев назад +1

    Really great, thank you !

  • @DamianBennett-d7u
    @DamianBennett-d7u Год назад

    This was truly amazing! Thank you so much for this perfect tutorial!

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

    That is a fantastic video. I learned a lot from it. Thank you.
    I have a question though, some of the data I want to save is automatically generated by other calculations in other cells. How can I adjust my code to erase those cells (that causes the calculations)?

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

      The current tutorial only retrieves the values but not the formulas from the data. So this shouldn't be an issue in your scenario.
      You can use the getRange() method on the calculation range and use either the clear() or clearContent() methods: developers.google.com/apps-script/reference/spreadsheet/range#clearoptions

  • @JoeAbramovich
    @JoeAbramovich 2 месяца назад +1

    is there a way to not collect the date and time along with the email? I just want the inputs. thanks for the tutorial!

    • @yagisanatode
      @yagisanatode  2 месяца назад +1

      Just omit the date time inclusion.

  • @AshNorton-ul4kx
    @AshNorton-ul4kx Год назад +2

    Thanks for the video!
    Noob asking: Instead of validating if all cells are empty (line 11), I simply want to validate if the last cell in my 12 cell array is blank. Please aid.

    • @yagisanatode
      @yagisanatode  Год назад +1

      Hi ash let's say that your array is called "cells". If you know the length of the array then you could say:
      if(cells[12] === ""){
      // Do something.
      }
      If you don't know the length of the last item in the array.
      if(cells[cells.length -1] === ""){
      // Do something
      }

  • @matteoferri9930
    @matteoferri9930 10 месяцев назад +1

    Hi you are super! A question: on mobile the button doesn't work! How I can fix it? For example with a checkbox

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

      Buttons unfortunately don't work on mobile. The common workaround, as you've discovered, is to use a checkbox that often programmatically resets.

  • @jakor89
    @jakor89 Год назад

    Thank you for this excellent content, this is very helpful! When I enter in 0 in distance or charge used I get an error even with validation, is it the code? Also, the date and time stamp is Australia’s and I am in North America, how do you change that? Thanks!

    • @yagisanatode
      @yagisanatode  Год назад

      You can change the locale from File > Settings : ruclips.net/video/0qntbVHJHuI/видео.html
      The validation error should be a result of the conditional formatting. Righ-click the cell an select the conditional formatting.
      You might also want to update the script file to head to Project Settings and update the locale there:
      ruclips.net/video/nKIJchyAOus/видео.html

  • @aizatramlee1193
    @aizatramlee1193 8 месяцев назад

    HI. THANK YOU FOR YOUR GREAT VIDEO.
    I have a question, how to activate authorization required because there are no warning sign if i submit the form that i create. Only me can fill the form because i create apps script using my email.
    Btw sorry for my broken english and i hope u can understand.

    • @yagisanatode
      @yagisanatode  8 месяцев назад

      In this tutorial, your app can be used by other editors. Later in this series, I show you how editors who don't have access to the cells can input data.

  • @amazingytvideos5214
    @amazingytvideos5214 2 года назад +1

    Good morning. What script (with button) can I use, IF
    I have 3 buttons, BREAKFAST, LUNCH, DINNER
    each button, once pressed will add a data log on another google sheet?

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

      This is definitely achievable. Check out my Hire Me page to make an enquiry on building custom code for your project. yagisanatode.com/google-workspace-developer/

  • @caseyr3290
    @caseyr3290 Год назад

    This is an amazing Video series!! For some reason my Input data range transfers all but one of my cells information. It will also not clear the data on my input sheet for that cell only. I have checked to make sure all the cells are included in the Data Range.

    • @caseyr3290
      @caseyr3290 Год назад

      Could it be something with this? const data = [...sourceVals];

    • @yagisanatode
      @yagisanatode  Год назад

      Thanks for the kind words. Are you getting any errors in the event log?

  • @AntoniaLim
    @AntoniaLim Год назад

    Fantastic. This was so helpful. Is it possible to add the data to specific tabs/Sheets based on conditions? for example if one of the values was X, then it would go to Sheet X, but if the value was Y then the data would go to Sheet Y

    • @yagisanatode
      @yagisanatode  Год назад

      Absolutely, you could use a conditional statement that would allow you to determine what sheet tab you want to add your data to. Check our JavaScript 'if'-statements and 'swtich'-statements.

  • @amazingytvideos5214
    @amazingytvideos5214 Год назад +1

    Good morning, its me again. what if, the data log, is to be put on a descending manner on the sheet? instead of ascending? meaning it will only put data log on the row directly beneath the tabloe header?

    • @yagisanatode
      @yagisanatode  Год назад

      Hi! This video should help answer your question: ruclips.net/video/6pugLx-ORU4/видео.html

  • @tess2020
    @tess2020 Год назад +1

    Hi. Does google sheets allow a sheet to be unaccessible ? For example, I don't want any other person to access the code sheet and modify the code. Thanks

    • @yagisanatode
      @yagisanatode  Год назад +1

      Hi TessView. No, not unless you published the script as an editor-addon internally within your Google Workspace Domain, or externally in the Google Workspace Marketplace. However, you could create a web app with apps script to do the same thing. Check our this tutorial for an introductory guide: yagisanatode.com/2020/11/25/creating-an-embedded-interactive-chain-story-app-with-google-apps-script-and-google-sheets/

  • @RadcliffeBromfield
    @RadcliffeBromfield 2 года назад +1

    Good Job, but does this apply to multiple users using the form at the same time or it's for a single user or one at a time?

    • @yagisanatode
      @yagisanatode  2 года назад +2

      Stay tuned. I'll be cover this in part 5 of the series when we migrate this over to a sidebar app.

    • @lemonyfresh8595
      @lemonyfresh8595 Год назад

      @@yagisanatode 8 months later but I can't find Part 5 to the series that answers this question? I'd love to find out as I'm in the middle of a project!

    • @yagisanatode
      @yagisanatode  Год назад

      @@lemonyfresh8595 Hi Lemony Fresh you can find it in the playlist here: ruclips.net/video/JyZzWLVpmmU/видео.html

  • @qtech108
    @qtech108 Год назад +1

    Thank you

  • @Thufpt
    @Thufpt Год назад

    thank you, my question is how can I change from column B to any other column and add more columns in the sheet input data?
    how can append the data to follow columns instead of rows?

    • @yagisanatode
      @yagisanatode  Год назад

      You can use the getRange() method to select you desired range and then use the setValues() method on that range. Check out the links in the video description for more information on this.

  • @line1station6
    @line1station6 Год назад

    i have a formula in one of my cell while collecting data but when I run the scripts it deletes the formula and formatting?
    your help is much appreciated.

    • @yagisanatode
      @yagisanatode  Год назад

      Take a look at the range that clear is being applied to. What would be a better range that would exclude the cell containing the formula?

  • @mpatey84
    @mpatey84 Год назад

    Thanks, is there a way that the data log can go to a different spreadsheet and not just the same spreadsheet?

    • @yagisanatode
      @yagisanatode  Год назад

      Yes. You can call the Sheet class (e.g. getSheetByName()) on multiple sheets. Just like we did when getting the input data from one sheet and then setting it in another.

  • @RahulBagul-q2w
    @RahulBagul-q2w Месяц назад

    Amazing Video
    but can we upload a document in input sheet and save it

    • @yagisanatode
      @yagisanatode  Месяц назад

      Do you mean uploading the contents of a doc and displaying in the Sheet?

  • @GoldnRule
    @GoldnRule Год назад +1

    Very Great tutorial!
    Can you help us in validation of cells to accept 0(zero) as input please 😁

    • @yagisanatode
      @yagisanatode  Год назад +1

      What have you tried so far?

    • @GoldnRule
      @GoldnRule Год назад

      @@yagisanatode i tried adding ==0 to anyEmtyCell. But right now i just thought maybe i should try !==0??
      Just need help sir, im still trying to learn Javascripting 😅

    • @yagisanatode
      @yagisanatode  Год назад

      @@GoldnRule You can do this in the sheet with Data Validation > Criteria > Is Equal to and then add 0. You can learn more about Google Sheets Data Validation in this series: ruclips.net/p/PLSDEbLgMgqvoVQA73Erj_Gky2K11v-CHh

  • @protestthebread1046
    @protestthebread1046 Год назад

    Is there a way to create a self updating input sheet? To account for unknown variables, and when they are found, to incorporate them into the data log. My current thought is to have a checkbox that, if it is set to TRUE, it will then prompt the user upon hitting submit to type in the relevant text. It then still updates the primary datasheet with the information inputted as is, but then updates the namedrange list in order to incorporate the new variable into the relevant dropdown menu.

    • @yagisanatode
      @yagisanatode  Год назад +1

      Yes you can validate the sheet this way. Check out the next tutorial in the series: ruclips.net/video/JyZzWLVpmmU/видео.html

  • @PinsewCreatives-y4z
    @PinsewCreatives-y4z 10 дней назад

    Hello!! Is there a way that the button also works on mobile version?

    • @yagisanatode
      @yagisanatode  9 дней назад

      Unfortunately, not with the mobile app. You can, however, user a checkbox to do the same.
      Here are two examples of checkboxes and the onEdit() simple trigger in action:
      yagisanatode.com/google-apps-script-create-a-select-all-checkbox-to-tick-checkboxes-in-any-desired-range-in-google-sheets/
      yagisanatode.com/add-the-editors-email-when-they-tick-the-check-box-in-google-sheets-with-apps-script/

  • @samer_Alkhafaji
    @samer_Alkhafaji Год назад +1

    hello so i did the some thing for point checkbox and i have the last calom have the total point i need when i do submit i don't want the sum to delete

    • @yagisanatode
      @yagisanatode  Год назад +1

      Don't clear the range that the sum is on. It will stay in the cell.

    • @samer_Alkhafaji
      @samer_Alkhafaji Год назад

      This what i did but i want the sum to be transferred with rest of the numbers.? Can i do something

    • @yagisanatode
      @yagisanatode  Год назад +1

      @@samer_Alkhafaji Yes, so when you clear the sheet. Create a new range that is one row less than the current one.

  • @BagasKJ
    @BagasKJ Год назад +1

    Can you submit like a weekly data entry (multiple rows) from this?

    • @yagisanatode
      @yagisanatode  Год назад +1

      You certainly could. I have built a number of sheets that provide a data entry point using just a sheet tab. In other instances, I use dialogues and sidebar, forms or AppSheet.

    • @BagasKJ
      @BagasKJ Год назад

      @@yagisanatode I'm very new to AppSheet do you have any reference I can read?

    • @yagisanatode
      @yagisanatode  Год назад

      @@BagasKJ Nothing specifically to what you are looking for but the links in the description should point you in the right direction.

    • @BagasKJ
      @BagasKJ Год назад +2

      @@yagisanatode Hi Scott, I did it! I create my first google sheet forms. I really like this! I am creating a form which has multiple entries at once, but when it tries to append the data, it just appended in one row. can you please help me with this? what code should I add to the script? thank you!

    • @BagasKJ
      @BagasKJ Год назад +2

      I asked chatgpt now it works lmao, thank you btw, Scott!

  • @reed41
    @reed41 Год назад

    I keep getting an error stating "ReferenceError: SpeadsheetApp is not defined" but I have my code exactly how you have it.

    • @yagisanatode
      @yagisanatode  Год назад +1

      Hi, Make sure you add an 'r' to 'SpreadsheetApp' .

  • @unknowuser8015
    @unknowuser8015 Год назад +1

    Is there a way if I add another data it will be inserted above the old data?

    • @yagisanatode
      @yagisanatode  Год назад

      Yes, there is. Check out this video for a guide: ruclips.net/video/6pugLx-ORU4/видео.html

  • @AndyNguyen-r3n
    @AndyNguyen-r3n Год назад

    can you do a tutorial to edit a row in google sheet? thanks

    • @yagisanatode
      @yagisanatode  Год назад

      Maybe, time permitted. What do you want to know?

  • @princemanreza
    @princemanreza 5 месяцев назад +1

    how to clear without clearing the formula?

    • @yagisanatode
      @yagisanatode  5 месяцев назад

      Don't capture the range with the formula.

  • @bakkajua
    @bakkajua 3 дня назад

    Does this work for Mobile?

    • @yagisanatode
      @yagisanatode  2 дня назад

      Hey there, you can't use buttons and AppScript-generated menu items on the mobile app, unforunately. One workaround is to trigger your script from a checkbox.

  • @annisakusuma93
    @annisakusuma93 4 месяца назад

    There's no script
    what happened?

    • @yagisanatode
      @yagisanatode  4 месяца назад

      Nothing. This is where we start for this part of the series.

  • @IndusHospitality
    @IndusHospitality Год назад

    Pls reply where is script😢

    • @yagisanatode
      @yagisanatode  Год назад

      The starter sheet for the tutorial is linked in the description.

  • @marcelobarajas7704
    @marcelobarajas7704 2 месяца назад

    Script is gone

    • @yagisanatode
      @yagisanatode  2 месяца назад

      We're starting from scratch here with this starter sheet. So there should not be any script here except for the name of the first function.
      I've added a comment to the script to explain this for future viewers but you will also not this is at 01:34 .