google-apps-script

Compare two sheet columns and copy data to first Sheet

南楼画角 提交于 2020-03-06 09:31:05
问题 I'm trying to find out the formula for matching CODE 1 between Sheet1 and Sheet2, then, copy 'Original','Lost' and insert 'Total 2019 Order' columns into Sheet 1 by corresponding CODE 1 , The google sheet is here: https://docs.google.com/spreadsheets/d/1SvMVC0P6eWcmaULEolu0zTr2wv6zlFl9-ttkgaxXcX8/edit?usp=sharing 回答1: use: =ARRAYFORMULA(IFNA(VLOOKUP(B2:B, Sheet2!B2:I, {8, 5}, 0))) spreadsheet demo 来源: https://stackoverflow.com/questions/60161952/compare-two-sheet-columns-and-copy-data-to

I cannot get input to work under google app script

≡放荡痞女 提交于 2020-03-05 02:56:13
问题 I'm writing a web app under google sheets and can't get an input field to work. What am I doing wrong? everything works but uname is always empty (not undefined). edit: I'm adding the full code after simplifying it as much as I could. In the log I get "name" regardless of the input I type in. In the file code.gs: function doGet () { var participant = {}; var templ = HtmlService.createTemplateFromFile('out'); return templ.evaluate();; } function formSubmit(name) { Logger.log("name " + name); }

Modify Code - Copy Certain Rows/Columns From one Spreadsheet to Another - Google Apps Script / Google Sheets

你离开我真会死。 提交于 2020-03-05 01:30:37
问题 I would like to incorporate the action the SORT QUERY is doing (above .getRange line of code) in this script. So instead of copying A2:F I would get Column B, C, D, E copied from ONLINESendNewSkusToGID to RECTOONLINE. function CopyNewOnlineSkusFromCDSToGID() { var spreadsheet = SpreadsheetApp.getActive(); spreadsheet.setActiveSheet(spreadsheet.getSheetByName('ONLINESendNewSkusToGID'), true); //=SORT(QUERY(JIRA JQL QUERY!A2:F,"SELECT B, C, D, E",0)) spreadsheet.getRange('A2:F').activate(); var

How to refresh the results of custom formulas automatically in Google Sheets?

China☆狼群 提交于 2020-03-05 00:29:05
问题 I do have simple custom function margin() in Google Sheet (using Apps Script), which takes a value from cell H55 in the sheet named "Exchange Rates" and simply returns the same value that is in the cell. function margin() { var price = 0; price = SpreadsheetApp.getActiveSpreadsheet().getRange("Exchange Rates!H55").getValue(); return price; }; If I put =margin() to any cell (eg. H56) - it works. But when I update the value in cell H55 , say... from the number 1,05 to 1,55 - nothing happens to

Google App Script regex replace for multiple values not working with single quote

ⅰ亾dé卋堺 提交于 2020-03-05 00:28:25
问题 Problem Using the below code i'd like to replace all "'NULL'" values to "NULL". Currently it will only replace one value. Code function generateSQLCode() { var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('seed-data'); var row_count = sheet.getLastRow(); var input_data = sheet.getRange(1, 1, row_count, 20).getValues(); var data = []; for (var i = 0; i < row_count; i++) { var row_data; } else if (input_data[i][0] == "entry") { row_data = input_data[i].shift(); row_data = "('" +

Google App Script regex replace for multiple values not working with single quote

一世执手 提交于 2020-03-05 00:27:14
问题 Problem Using the below code i'd like to replace all "'NULL'" values to "NULL". Currently it will only replace one value. Code function generateSQLCode() { var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('seed-data'); var row_count = sheet.getLastRow(); var input_data = sheet.getRange(1, 1, row_count, 20).getValues(); var data = []; for (var i = 0; i < row_count; i++) { var row_data; } else if (input_data[i][0] == "entry") { row_data = input_data[i].shift(); row_data = "('" +

How to refresh the results of custom formulas automatically in Google Sheets?

我是研究僧i 提交于 2020-03-05 00:26:21
问题 I do have simple custom function margin() in Google Sheet (using Apps Script), which takes a value from cell H55 in the sheet named "Exchange Rates" and simply returns the same value that is in the cell. function margin() { var price = 0; price = SpreadsheetApp.getActiveSpreadsheet().getRange("Exchange Rates!H55").getValue(); return price; }; If I put =margin() to any cell (eg. H56) - it works. But when I update the value in cell H55 , say... from the number 1,05 to 1,55 - nothing happens to

RPG gaming dice roll skill checker script question

…衆ロ難τιáo~ 提交于 2020-03-05 00:22:24
问题 For my RPG gaming skill check script... In the below script (created by Edmund chan kei yun, a member at StackOverflow) cells are checked for the highest numbers (after simulated several d6 dice rolls by another script), and then text is copied from a table (to define resulting actions). I would also need dice result combos like 666 and 111 to have their own table results. Such will have their own columns/rows in the table. Could someone help me to update the script to include the reading of

TypeError: Cannot read property 'insertSlide' of null (line 60, file “Code”)

懵懂的女人 提交于 2020-03-04 21:35:02
问题 Would be grateful for any guidance on how to fix this error. Please see below code which gives the error, // Copy a slide from another presentation and inserts it. var otherPresentation = SlidesApp.openById('1Fz6YWCyLIdHfDoonz-40qRlmnNCWwROIQjXqYwmRxS8'); var currentPresentation = SlidesApp.getActivePresentation(); var slide_v1 = otherPresentation.getSlides[0]; var insertionIndex = 1; currentPresentation.insertSlide(insertionIndex, slide_v1); 回答1: Thanks to Tanaike and some changes to the

TypeError: Cannot read property 'insertSlide' of null (line 60, file “Code”)

为君一笑 提交于 2020-03-04 21:34:13
问题 Would be grateful for any guidance on how to fix this error. Please see below code which gives the error, // Copy a slide from another presentation and inserts it. var otherPresentation = SlidesApp.openById('1Fz6YWCyLIdHfDoonz-40qRlmnNCWwROIQjXqYwmRxS8'); var currentPresentation = SlidesApp.getActivePresentation(); var slide_v1 = otherPresentation.getSlides[0]; var insertionIndex = 1; currentPresentation.insertSlide(insertionIndex, slide_v1); 回答1: Thanks to Tanaike and some changes to the