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 techno@admin (see all)
- No.1 X-men X1 Ultra-rugged Smartphone – 7 Proof Mobile Phone - December 19, 2014
- Micromax Launches YUREKA Mobile with CyanogenMod OS for Rs. 8999 – Ready to PLAY GOD - December 18, 2014
- Year End Clearance Sale from 1949deal – iOcean Smartphone Coupon and other Deals - December 16, 2014