Replace Link Spreadsheet

By url

https://docs.google.com/spreadsheets/d/<FILEID>

Example responseContent = "mynewsheet|1TwitPJS_.......rRbeqXnc"

Is this block code made to be combined with the previous block code on one screen?

why on me not make change anything. the result remains the same as the result of the block codes above

Yes

Please explain what you mean


that's my result. not going to access of spreadsheet

Looks like you have set the label to the Web1.GotText url and not responseContent?

image
the result

image
the blockcodes.

why can not access(view) the sheet of spreadsheet? do you created just for that? just for show the name n url.

I mean How to view the link of spreadsheet

There you go :slight_smile:

how to view the link of spreadsheet?. can you solve it?

before that thanks for your nice tutorial step by step. I enjoy it.

Why not try putting the output of setSheetUrl to a label

Come on....it is not that difficult

yeah. its so easy. n then how to access the link

What do you mean by access?

Do you want to open the spreadsheet on your device, or send data to it (then get data from it) ? Or something else?

Yes you get the point. I mean, when we get the link and then how to access (open the spreadsheet) by device by a button

Not going to play pin the tail on the donkey....

https://ai2.metricrat.co.uk/_/search?query=sheet&scope=site&showTabs=false&page_token=CKywiKHZLhAA

image
when I get to open the spreadsheet by the link that we generate / get. I will to copy the data from excell and then the Spreadsheet URL I Put it to the google app script by a button after that I'm gonna to input the data(time) by scan QRcode

<var ss = SpreadsheetApp.openByUrl("linkspreadsheet");
var sheet = ss.getSheetByName("Sheet1");

function doGet(e){
  var action  = e.parameter.action;
  
  if(action == "in")
    return inTime(e);
   
  if(action == "out")
    return outTime(e);
  
}


function doPost(e){
  var action  = e.parameter.action;
  
  if(action == "in")
    return inTime(e);
   
  if(action == "out")
    return outTime(e);
  
}

function inTime(e){
  var id = e.parameter.id;
  var values = sheet.getRange(2,1,sheet.getLastRow(),1).getValues();
  
  for(var i = 0 ; i<values.length ; i++){
    if(values[i][0] == id){
      i=i+2;
      var in_time = Utilities.formatDate(new Date(), "IST", "HH:mm:ss");
      sheet.getRange(i,3).setValue(in_time);
      return ContentService.createTextOutput("Thank You ! Your In Time is "+in_time).setMimeType(ContentService.MimeType.TEXT);
    }
  }
  return ContentService.createTextOutput("Id Not Found").setMimeType(ContentService.MimeType.TEXT);
}


function outTime(e){
  var id = e.parameter.id;
  var values = sheet.getRange(2,1,sheet.getLastRow(),1).getValues();
  
  for(var i = 0 ; i<values.length ; i++){
    if(values[i][0] == id){
      i=i+2;
      var out_time = Utilities.formatDate(new Date(), "IST", "HH:mm:ss");
      sheet.getRange(i,4).setValue(out_time);
      return ContentService.createTextOutput("Thank You ! Your Out Time is "+out_time).setMimeType(ContentService.MimeType.TEXT);
    }
  }
  return ContentService.createTextOutput("Id Not Found").setMimeType(ContentService.MimeType.TEXT);
}>Preformatted text

I Hope you can solve it ! Please!

what the code for get url spreadsheet that active and get sheet that active?

See here:

How to Input data with color cell in spreadsheet by app mit app inventor use google script

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.