{"id":5505,"date":"2024-12-31T17:15:51","date_gmt":"2024-12-31T17:15:51","guid":{"rendered":"https:\/\/obsidiansofteducation.com\/?page_id=5505"},"modified":"2025-01-10T15:01:11","modified_gmt":"2025-01-10T15:01:11","slug":"send-data-to-google-sheet-from-mit-app-inventor","status":"publish","type":"page","link":"https:\/\/obsidiansofteducation.com\/index.php\/send-data-to-google-sheet-from-mit-app-inventor\/","title":{"rendered":"Send Data to Google Sheet from MIT App Inventor"},"content":{"rendered":"\n<p>Hello friends and welcome to Obsidian Soft,<\/p>\n\n\n\n<p>In today\u2019s MIT App Inventor tutorial, I will teach you a simple and easy way of writing to a Google sheet&nbsp;<strong>from<\/strong>&nbsp;an MIT App Inventor App.&nbsp;<\/p>\n\n\n\n<p>Some apps require data to be written to a spreadsheet instead of a database like CloudDB. Take the example of a quiz app that you have developed for your students (I have already taught you how to make&nbsp;<a href=\"https:\/\/obsidiansofteducation.blogspot.com\/p\/mit-app-inventor-projects.html\" target=\"_blank\" rel=\"noreferrer noopener\">quiz apps<\/a>). Now, you may want to know how your students are performing in the quiz so you can write code in your quiz app that whenever a person takes the quiz, the score is written to a Google sheet which you can view at any time to look at the scores of the students.<\/p>\n\n\n\n<p>So, today, I will teach you how your app can easily write to a Google sheet.<\/p>\n\n\n\n<p>First of all, we need a Google sheet so create one by going to:<\/p>\n\n\n\n<p><a href=\"https:\/\/docs.google.com\/spreadsheets\/u\/0\" target=\"_blank\" rel=\"noopener\">https:\/\/docs.google.com\/spreadsheets\/u\/0<\/a><\/p>\n\n\n\n<p>Click on the big + and create a blank Google sheet. A new spreadsheet will open. Change the name from \u201cUntitled Spreadsheet\u201d on top to \u201cStudents\u201d. Now go to the menu. You will find Tools there. Click on it and choose the \u201cCreate a new form\u201d option.<\/p>\n\n\n\n<p>We need to change the questions to the kind of data coming in from the MIT App Inventor app. In this tutorial, I will be sending students\u2019 names and ages. If you have an email address in it by default chosen in it, you need to remove that question by going to settings -&gt;defaults -&gt;form defaults -&gt;Do not collect email address<\/p>\n\n\n\n<p>Look below at the screenshot<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"506\" src=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/chrome_2pjQYVDDko-1024x506.png\" alt=\"\" class=\"wp-image-5827\" srcset=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/chrome_2pjQYVDDko-1024x506.png 1024w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/chrome_2pjQYVDDko-300x148.png 300w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/chrome_2pjQYVDDko-768x379.png 768w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/chrome_2pjQYVDDko-1536x758.png 1536w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/chrome_2pjQYVDDko.png 1910w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Now, go back to questions and add questions for name and age.<\/p>\n\n\n\n<p>For both questions, choose a short answer as the answer type.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"506\" src=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/chrome_ldsN5DxDsJ-1024x506.png\" alt=\"\" class=\"wp-image-5829\" srcset=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/chrome_ldsN5DxDsJ-1024x506.png 1024w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/chrome_ldsN5DxDsJ-300x148.png 300w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/chrome_ldsN5DxDsJ-768x379.png 768w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/chrome_ldsN5DxDsJ-1536x758.png 1536w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/chrome_ldsN5DxDsJ.png 1910w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Click on the Publish button on the top and choose manage option from the dialog that opens up.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/V8tVWf4dJl-1024x576.png\" alt=\"\" class=\"wp-image-5830\" srcset=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/V8tVWf4dJl-1024x576.png 1024w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/V8tVWf4dJl-300x169.png 300w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/V8tVWf4dJl-768x432.png 768w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/V8tVWf4dJl-1536x864.png 1536w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/V8tVWf4dJl.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The share permissions dialog will open up where you have to change General access to &#8220;Anyone with link&#8221;. Click on Done button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"506\" src=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/chrome_yDPdQI5o6E-1024x506.png\" alt=\"\" class=\"wp-image-5831\" srcset=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/chrome_yDPdQI5o6E-1024x506.png 1024w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/chrome_yDPdQI5o6E-300x148.png 300w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/chrome_yDPdQI5o6E-768x379.png 768w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/chrome_yDPdQI5o6E-1536x758.png 1536w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/chrome_yDPdQI5o6E.png 1910w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>After this, click on the publish button on the dialog.<\/p>\n\n\n\n<p>At any time, if you accidentally close the form, you can open it again for editing by going to Tools in your \u201cStudents\u201d spreadsheet menu<\/p>\n\n\n\n<p>Tools -&gt; Manage Form -&gt; Edit form<\/p>\n\n\n\n<p>Now, create a new project in MIT App Inventor. Call it StudentData.<\/p>\n\n\n\n<p>Drag and drop a&nbsp;<strong>horizontal arrangement<\/strong>&nbsp;from&nbsp;<strong>Layouts<\/strong>&nbsp;onto the Viewer.&nbsp; Make align horizontal and align vertical center. Make height 10% and width fill parent. Put a&nbsp;<strong>label<\/strong>&nbsp;and&nbsp;<strong>textBox<\/strong>&nbsp;from&nbsp;<strong>User Interface<\/strong>&nbsp;inside it. This is for the student\u2019s name so name them appropriately: nameLbl and nameTxt. Duplicate the horizontal arrangement by pressing&nbsp;<strong>Ctrl&nbsp; + C and Ctrl + V<\/strong>&nbsp;for&nbsp;<strong>Windows<\/strong>&nbsp;OR&nbsp;<strong>Command + C and Command +&nbsp; V<\/strong>&nbsp;for&nbsp;<strong>MacOS<\/strong>. Make changes for Age.<\/p>\n\n\n\n<p>Add a&nbsp;<strong>button<\/strong>&nbsp;for submit from&nbsp;<strong>User Interface<\/strong>.<\/p>\n\n\n\n<p>From&nbsp;<strong>Connectivity<\/strong>, drag and drop a&nbsp;<strong>Web<\/strong>&nbsp;component onto the viewer.<\/p>\n\n\n\n<p>Our basic screen design is done so go to the blocks section.<\/p>\n\n\n\n<p>When submitBtn is clicked, we want to send the user-entered data to the Google sheet so get the click event.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2024\/12\/component_event201.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>Get web1\u2019s seturl block. And put a join in it. Add three more slots in it.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2024\/12\/blocks2059.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>Now, follow me very carefully.<\/p>\n\n\n\n<p>Go back to the form that you created using Spreadsheet. If you accidentally closed it, you can open it again by going to Tools in your spreadsheet<\/p>\n\n\n\n<p>Tools -&gt; Manage Form -&gt; Edit form<\/p>\n\n\n\n<p>Inside your form, you will have those 3 dots next to send button. Click on those dots and choose&nbsp;<strong>Get prefilled link.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/WLrUNkDk80-1024x576.png\" alt=\"\" class=\"wp-image-5832\" srcset=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/WLrUNkDk80-1024x576.png 1024w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/WLrUNkDk80-300x169.png 300w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/WLrUNkDk80-768x432.png 768w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/WLrUNkDk80-1536x864.png 1536w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2025\/01\/WLrUNkDk80.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Another browser window will open up. Copy the link from the browser window.<\/p>\n\n\n\n<p>Paste this link in the set Web1.url block in submitBtn click event.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2024\/12\/Screenshot202023-08-0220at2010.24.1220AM.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>Replace the word&nbsp;<strong>prefill<\/strong>&nbsp;with the word&nbsp;<strong>formResponse<\/strong>. Type it exactly in this way:<\/p>\n\n\n\n<p><strong>formResponse<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2024\/12\/Screenshot202023-08-0220at2010.24.3320AM.png\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong><a href=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgateQVJV2ppmVoZcmhQgCVb6vlshQyi1kjeoa1S9WHKDA58ePOT58Qcc4pYLVPYibNojYW_V9VgrZBfe_juJxTA3JibRizTfwfLkazK6-cjSfi1g9evv13t9Jr6kX1RYvooLrftLUtEndZzpXhSv88398UaH9PPhcjMeIK2Np26Cvta2eBTWDZBta9JTA\/s1782\/Screenshot%202023-08-02%20at%2010.24.33%20AM.png\" target=\"_blank\" rel=\"noopener\"><\/a><\/strong><\/p>\n\n\n\n<p>Now, we need something more from the form.<\/p>\n\n\n\n<p>Go back to the form and provide some values for name and age and press&nbsp;<strong>getlink<\/strong>&nbsp;button.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2024\/12\/Screenshot202023-08-0220at2010.27.4820AM.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>Copy and paste the new link in some text file as we need the two entry codes for both inputs i.e. name and age.<\/p>\n\n\n\n<p>We will get something like this&nbsp;<em>(I have deleted some letters from this address as this points to a Google Sheet on my account: you will have to use your own Google Sheet for your project)<\/em><\/p>\n\n\n\n<p><a href=\"https:\/\/docs.google.com\/forms\/d\/e\/1FAGycfw\/viewform?usp=pp_url&amp;entry.1932012884=obsidian&amp;entry.1402638227=100\" target=\"_blank\" rel=\"noopener\">https:\/\/docs.google.com\/forms\/d\/e\/1FAGycfw\/viewform?usp=pp_url&amp;entry.1932012884=obsidian&amp;entry.1402638227=100<\/a><\/p>\n\n\n\n<p>Copy and paste the first information about entry&nbsp;<strong>&amp;entry.1932012884=<\/strong>&nbsp;in the second slot<\/p>\n\n\n\n<p><a href=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEjYrBOcA28HHsl1j3ayonSCmBkR6H3zMjBU3VBat1cwofCC8wXEyeEyNqQLG8JV0DQqqsJjmvGBAPM-51jVGcrnUCHxk8MKhInI452YD6LzmjhZAIWvTYrBicsO4ogEBCACDiciVanjU9ioK8G-7dIHPhOOypL1J-OLeFfQfoYq78hWzQol2U2kNicdvFs\/s1824\/Screenshot%202023-08-02%20at%2010.36.18%20AM.png\" target=\"_blank\" rel=\"noopener\"><\/a>Replace&nbsp;<strong>&amp;<\/strong>&nbsp;by&nbsp;<strong>?:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2024\/12\/Screenshot202023-08-0220at2010.36.3320AM.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>This replacement only has to be done for the first entry and not for subsequent entries. (<em>Your code will be different. This is just for example<\/em>)<\/p>\n\n\n\n<p>In the third slot, get the nameTxtBox.text block (whatever user has entered as the name)<\/p>\n\n\n\n<p>In the fourth slot, copy and paste the information about second entry i.e.&nbsp;<strong>&amp;entry ( numbers from link)=<\/strong><\/p>\n\n\n\n<p>In the fifth slot, get the ageTxtBox.text block&nbsp;(whatever user has entered as the age)<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2024\/12\/blocks2060.png\" alt=\"\"\/><\/figure>\n\n\n\n<p><a href=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEjWPGaKHkjQyu1kNdDlMriotFKlDYqF4CurEe1Ijpr8ezsLet0YX17p3HeqXxJzlC1PIg0m0etuX6kVgXRj28DcUyww1gYZ6PxG9eju0V6Bj_94R3k3eVg52bCAj_D1JbTFWKSShWaj0xAjCsto8X7LSw-7vmjKOZwBcIi6mAOTQwyVdfYh3B0n-9phNak\/s1436\/blocks%20(60).png\" target=\"_blank\" rel=\"noopener\"><\/a><\/p>\n\n\n\n<p>At the end, call web\u2019s get procedure.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2024\/12\/blocks2061.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>Try the app, and you will see that data is added in the spreadsheet in a sheet called&nbsp;<strong>form responses 1<\/strong>&nbsp;inside your main spreadsheet Students.<\/p>\n\n\n\n<p>I hope you liked this class and found this method of writing data to a Google Sheet super easy.&nbsp;<\/p>\n\n\n\n<p>If you like my tutorials, consider supporting me:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><a href=\"https:\/\/obsidiansoft.gumroad.com\/l\/cxdft\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"372\" height=\"196\" src=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2024\/12\/donate-button-1.png\" alt=\"\" class=\"wp-image-5381\" style=\"width:217px;height:auto\" srcset=\"https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2024\/12\/donate-button-1.png 372w, https:\/\/obsidiansofteducation.com\/wp-content\/uploads\/2024\/12\/donate-button-1-300x158.png 300w\" sizes=\"auto, (max-width: 372px) 100vw, 372px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>You can have a look at the video here:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<p class=\"responsive-video-wrap clr\"><iframe loading=\"lazy\" title=\"Send data to Google Sheet in MIT App Inventor (SUPER EASY) | Send App Inventor data to Google Sheet\" width=\"1200\" height=\"675\" src=\"https:\/\/www.youtube.com\/embed\/JQzDKuzyUoQ?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<\/div><\/figure>\n\n\n\n<p><strong>Please like my videos and share it with your friends and family. Also, subscribe to my channel and press the bell icon so you don\u2019t miss any of the great projects I have planned for you.<\/strong><\/p>\n\n\n\n<p><a href=\"https:\/\/www.youtube.com\/c\/obsidiansofteducation\" target=\"_blank\" rel=\"noopener\">https:\/\/www.youtube.com\/c\/obsidiansofteducation<\/a><\/p>\n\n\n\n<p><strong>Please like my Facebook page and Instagram page for more educational resources and tips.<\/strong><\/p>\n\n\n\n<p><strong>Facebook:<a href=\"https:\/\/www.blogger.com\/blog\/page\/edit\/4947000819484484884\/7140650632339107612#\" target=\"_blank\" rel=\"noopener\">&nbsp;https:\/\/www.facebook.com\/ObsidianSoft\/<\/a><\/strong><\/p>\n\n\n\n<p><strong>Instagram:<a href=\"https:\/\/www.blogger.com\/blog\/page\/edit\/4947000819484484884\/7140650632339107612#\" target=\"_blank\" rel=\"noopener\">&nbsp;https:\/\/www.instagram.com\/obsidiansoftapps\/<\/a><\/strong><\/p>\n\n\n\n<p><strong>Pinterest:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-rich is-provider-pinterest wp-block-embed-pinterest\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"oceanwp-oembed-wrap clr\"><iframe loading=\"lazy\" title=\"Obsidian Soft\" src=\"https:\/\/assets.pinterest.com\/ext\/embed.html?grid=obsidiansoft&#038;src=oembed\" height=\"900\" width=\"450\" frameborder=\"0\" scrolling=\"no\" ><\/iframe><\/div>\n<\/div><\/figure>\n\n\n\n<p><strong>For links to free educational apps, have a look at the&nbsp;<a href=\"https:\/\/obsidiansofteducation.com\/index.php\/mobile-apps\/\">educational apps page<\/a><\/strong><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello friends and welcome to Obsidian Soft, In today\u2019s MIT App Inventor tutorial, I will teach you a simple and easy way of writing to a Google sheet&nbsp;from&nbsp;an MIT App Inventor App.&nbsp; Some apps require data to be written to a spreadsheet instead of a database like CloudDB. Take the example of a quiz app [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-5505","page","type-page","status-publish","hentry","entry"],"_links":{"self":[{"href":"https:\/\/obsidiansofteducation.com\/index.php\/wp-json\/wp\/v2\/pages\/5505","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/obsidiansofteducation.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/obsidiansofteducation.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/obsidiansofteducation.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/obsidiansofteducation.com\/index.php\/wp-json\/wp\/v2\/comments?post=5505"}],"version-history":[{"count":2,"href":"https:\/\/obsidiansofteducation.com\/index.php\/wp-json\/wp\/v2\/pages\/5505\/revisions"}],"predecessor-version":[{"id":5836,"href":"https:\/\/obsidiansofteducation.com\/index.php\/wp-json\/wp\/v2\/pages\/5505\/revisions\/5836"}],"wp:attachment":[{"href":"https:\/\/obsidiansofteducation.com\/index.php\/wp-json\/wp\/v2\/media?parent=5505"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}