var sheet = SpreadsheetApp.openById('11CrzziypWFfXREsdfsdfsdfGaUF_MfAn6dJhBOY').getSheetByName('employeVales'); var lastRow = sheet.getLastRow(); var cell = sheet.getRange(3, 1,lastRow-2,7).getValues();--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/ec6f3297-e95f-455b-9177-9f4086341f07%40googlegroups.com.
var sheet = SpreadsheetApp.openById('11CrzzY').getSheetByName('employeeVales'); var lastRow = sheet.getLastRow(); var cell = sheet.getRange(3, 1,lastRow-2,7).getValues(); Array.prototype.transpose = function() { var a = this; return Object.keys(a[0]).map(function (c) { return a.map(function (r) { return r[c]; }); }); }
cell = cell.transpose;
Logger.log(cell)
cell.splice(2,1); cell.splice(4,1);
cell = cell.transpose;To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/ec6f3297-e95f-455b-9177-9f4086341f07%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/61d3ffde-ae8d-4b0a-ad56-56335ecdb28d%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/ec6f3297-e95f-455b-9177-9f4086341f07%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.
This really cool. It worked perfectly!I don't understand how this function knows to do something to the array cell when it has nothing reffering to it?
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/ec6f3297-e95f-455b-9177-9f4086341f07%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/61d3ffde-ae8d-4b0a-ad56-56335ecdb28d%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/06944a44-42f5-4b52-8237-51a256d8e6ac%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/CAHpDaiiV5yqu3%3DCPUM4Ex8PS8z%3DQA7msL%3D%2BLamTbTwxvbcs2Fw%40mail.gmail.com.
<form method="get" name="search" class="fancy-form">
<input list="funcionarioValeIDandNameList"size="50" type="text" placeholder="ID ou NOME DO FUNCIONARIO" name="funcionarioIDandNameIdSerach" id="funcionarioIDandNameIdSearch" onkeypress="if(event.keyCode=='13'){document.form1.OKSearch.focus();return false;}" > <datalist id="funcionarioValeIDandNameList" > <option disabled selected value=""> </option> </datalist> <input list="mon" type="text" placeholder="MES" name="month" id="month" size="2" > <datalist id="mon" > <option disabled selected value=""></option> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option>6</option> <option>7</option> <option>8</option> <option>9</option> <option>10</option> <option>11</option> <option>12</option> </datalist> <input list="y" type="text" name="year" placeholder="ANO" id="year" size="5" > <datalist id="y" > <option disabled selected value=""> </option> <option>2017</option> <option>2018</option> <option>2019</option> </datalist> <Input type="button" class="buttonGreenNavBar"value=" 🔎 " onclick="formfuncionarioValeSubmit()"> </form>
<div id="HtmlTableElement1"></div>
function formfuncionarioValeSubmit() {// get the search selection to filter// startLoader(); google.script.run.withSuccessHandler(reloadTable)// feed table with filtered results .testeQueryAndRemoveColumn(document.forms['search']);//get search values to appscript code
}
function reloadTable(table) { document.getElementById("HtmlTableElement1").innerHTML = table; //load table to html element }
function testeQueryAndRemoveColumn(fieldData){// remove column
var funcionarioIDandNameIdSerach = fieldData.funcionarioIDandNameIdSerach.toString(); //Logger.log(funcionarioIDandNameIdSerach); var funcionarioId = funcionarioIDandNameIdSerach.split(" | ")[0] // split and convert value to string. var month = fieldData.month; var year = fieldData.year; var sheet = SpreadsheetApp.openById('11CrzziypWFfXREktGXA31PKJJPeGaUF_MfAn6dJhBOY').getSheetByName('employeVales'); var lastRow = sheet.getLastRow(); var cell = sheet.getRange(3, 1,lastRow-2,6).getValues(); // Logger.log(cell)Array.prototype.transpose = function() { var a = this; return Object.keys(a[0]).map(function (c) { return a.map(function (r) { return r[c]; }); }); }//transpose the array, because getValues() returns an array of rowscell = cell.transpose();
cell.splice(2,1); // removes the second column... count starts at 0//if now you need an array or rows again, just transpose againcell = cell.transpose();// Logger.log(cell)
var data2D = cell.filter(function(item) {//filter by user Id and by spliting month and year var dateSplit = item[3].split('/'); return dateSplit[1] === month && // position Month[1] of the date dateSplit[2] === year && // position year[2] of the date item[1] == funcionarioId // position funcuionario[1] of the array}); //Logger.log(data2D); var data = data2D; var table = "<table id='table1' border='0' ><tr> <th>Item ID</th> <th>Funcionario ID</th> <th>DATA</th> <th>DESCRIPTION</th> <th>VALOR</th> <th>TIMESTAMP</th> </tr>"; //<td><input type='checkbox' /></td> for( var i=0; i<data.length; i++ ) {//rows table = table.concat("<tr>"); for( var j=0; j<data[0].length; j++ ) {//column table = table.concat("<td>"); table = table.concat(data[i][j].toString()); table = table.concat("</td>"); } //table = table.concat("<td><input type='checkbox' name='check-tab1'></td></tr>"); } table= table.concat("</table>"); // Logger.log(table); return table;}
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/ec6f3297-e95f-455b-9177-9f4086341f07%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/61d3ffde-ae8d-4b0a-ad56-56335ecdb28d%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/06944a44-42f5-4b52-8237-51a256d8e6ac%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.