user2753644
user2753644

Reputation: 21

How to receive parameter values in google Sheet script and use parameter it in sql query

I have the following googleSheet URL:

https://docs.google.com/spreadsheets/d/19D-ApX1M_vuGUVOSIUrxrpyVna6pxBk86abTfmXRzBI/edit#gid=0?empId=1203&DepId=MCA

I want to pass query String parameter in google sheet url and use it in to sheet script

I use this code in sheet script

var url = SpreadsheetApp.getActiveSpreadsheet().getUrl();

above url give me only

https://docs.google.com/spreadsheets/d/19D-ApX1M_vuGUVOSIUrxrpyVna6pxBk86abTfmXRzBI/edit

I want to use all parameters in url like

https://docs.google.com/spreadsheets/d/19D-ApX1M_vuGUVOSIUrxrpyVna6pxBk86abTfmXRzBI/edit#gid=0?empId=1203&DepId=MCA

how it is possible to get parameters empId and DepId from googleSheet in Script

Upvotes: 0

Views: 885

Answers (1)

Wicket
Wicket

Reputation: 38219

This is not possible by using the Google Apps Script's Spreadsheet Service. It could be possible by using the creating a web app and using event object. For further details see Web Apps.

Upvotes: 1

Related Questions