Fetch Data from Google Spreadsheet – Hello, This is the 6th Google Apps Script tutorial in which I will show how to fetch data from Google Spreadsheet into Form fields. In the 5th part of Google Apps Scripting How to series, I have shared information about writing data into Google Spreadsheet. In this post, I will show How to Fetch Data from Google Spreadsheet into Google Form Fields.
- Create Custom Menu, Call Function and Send Customized Mail from Spreadsheet
- Google Script to Write Data in Spreadsheet
- Google Script to Send Email
- Google Script to Create GUI Application
Fetch Data from Google Spreadsheet File
It is very simple to fetch data from Google Spreadsheet in Google Form Fields. In this tutorial I will show how to fetch particular record like based on primary key just like in any other database. See the Spreadsheet below in which User Id column is used to store unique key value.
In the earlier post I have already shown how to create UI Application using Google Apps Scripting. Now you just need to add one more textbox and label which will be used as search box.
Trick to Fetch the data from Google Spreadsheet is very simple, all you need to do is find the required row id. Data in Spreadsheet is stored just like 2D Array. Suppose if the user searches for “a001” user id then it is row 2 of the sheet. And to display the value of corresponding Name in the text box you have to set its value with sheetdata. Where  means the data is in second row and  means value of first column.
Complete Code to Fetch Data from Google SpreadSheet
Try this and comment below for when of any problems.
Latest posts by Achin Jain (see all)
- Top 3 below $150 Mobiles: ECOO Focus E01, THL T6 PRO, CUBOT S168 - October 28, 2014
- Intex Aqua Amaze – Cheap Octa-Core HD Mobile with 13MP Camera - October 27, 2014
- Lenovo Rocstar A319 – Cheap Music Smartphone with Dolby Digital Plus technology - October 26, 2014