Arun Prakash
Arun Prakash

Reputation: 441

In what format the query parameter in google app script stored?

I was trying just if/else in google app script. The following code should give "arun" as output, but its showing "prakash" . What's wrong with my code?

URL : https://script.google.com/macros/s/AKfycbzNYCFOofexc4AuA58M0yK6amiA0xcuAYuEJBbsRNgT7f7bD3AE/exec?queryString=arun

function doGet(request){
   if(request.queryString=="arun"){
      return HtmlService.createHtmlOutput("arun");
  }else{
   return HtmlService.createHtmlOutput("prakash");
   }
  }

Upvotes: 0

Views: 100

Answers (1)

Kriggs
Kriggs

Reputation: 3778

You forgot to check within the parameters, request.parameter.queryString.

Upvotes: 2

Related Questions