Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9782

Running Multiple scripts in same sheet [closed]

$
0
0

I have a spreadsheet with multiple sheets and just added a custom Menu with sidebar, Im trying to figure out how to use two scripts,1st script to show the menu and show a form

2nd script to have second submenu with sidebar and upload option to upload pdf files directly to my g drive.

I was able to track down two codes that work when they are in separate worksheets but i cant figure out how to connect them together in one

I don't know much about coding so please any help would be great.

function onOpen() {  SpreadsheetApp.getUi()    .createMenu("Custom Menu")    .addItem("Show form", "index")    .addToUi();}function showSimpleSidebar() {  var html =    HtmlService.createHtmlOutputFromFile("index").setTitle("text");  SpreadsheetApp.getUi().showSidebar(html);}function doGet() {  return HtmlService.createTemplateFromFile('index').evaluate()  .addMetaTag('viewport', 'width=device-width, initial-scale=1')  .setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL)}var url = 'https://docs.google.com/spreadsheets/d/1hW2WoVrDZycsCvLf05pgf4okn3JqJ75iAa8iFRRddCdhRE/edit?usp=sharing'var sh = 'File'var folderId = '1L9fXRDHuF-Hg54d345rFNIvu2sJsUqvtlp4'function processForm(formdata){  var superscript = SuperScript.initSuper(url,sh)  var formObject = {}  formdata.forEach(element => formObject[element.name] = element.value)  var file = superscript.uploadFile(folderId,formObject.myfile.data,formObject.myfile.name)  var ss= SpreadsheetApp.openByUrl(url);  var ws=ss.getSheets()[0]   ws.appendRow([     new Date(),    formObject.nama,"'"+formObject.kelas,    formObject.subjek,     file.getUrl()  ]);}

Viewing all articles
Browse latest Browse all 9782

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>