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)
- Christmas and Doogee Titans 2 DG700 Presale promotion Promotion on 1949deal.com - November 24, 2014
- Micromax Bolt AD4500 Price India Rs. 5249, KitKat OS, Dual Front Speakers - November 21, 2014
- No.1 Mi4(Xiaomi Mi4 Clone) Comparison with Kingzone N3 Mobile Phone - November 19, 2014