If value is true in Column A, set Column C one higher

Array Structure: A1:A4 rangeValues will look like this: [ [A1], [A2], [A3], [A4] ] rangeValues[0] is the array: [A1] rangeValues[1] is the array: [A2] rangeValues[0][0] is the element/value: A1 rangeValues[0][1] is value: undefined A1:B4 rangeValues will look like this: [ [A1,B1], [A2,B2], [A3,B3], [A4,B4] ] Now, rangeValues[0] is array: [A1,B1] rangeValues[0][0] is element/value: A1 rangeValues[0][1] … Read more

How to filter an array of arrays?

ECMAScript 6 let filtered = arr.filter(dataRow => dataRow[2] === ‘Red’); As noted by @ozeebee, ES6 is currently not supported in Google App Scripts, so you should try the following: ECMAScript 5 var filtered = arr.filter(function (dataRow) { return dataRow[2] === ‘Red’; }); In the comments, “classic way” refers to the ES5 method. Explanation .filter function … Read more

Sort multidimensional array by date column, then use other column values if dates are the same

Update I recently answered this question in a much more capable manner in the “definitive” topic on sorting multidimensional arrays. You can safely skip reading the rest of this answer and directly follow the link for a much more capable solution. Original answer The function uasort lets you define your own comparison function. Simply put … Read more

Pass 2D array to another Activity

You can use putSerializable. Arrays are serializable. To store: bundle.putSerializable(“list”, selected_list); // Here bundle is Bundle object. To access: String[][] passedString_list = (String[][]) bundle.getSerializable(“list”); Example Intent mIntent = new Intent(this, Example.class); Bundle mBundle = new Bundle(); mBundle.putSerializable(“list”, selected_list); mIntent.putExtras(mBundle);

How to select multiple rows from mysql with one query and use them in php

Use repeated calls to mysql_fetch_assoc. It’s documented right in the PHP manual. http://php.net/manual/function.mysql-fetch-assoc.php // While a row of data exists, put that row in $row as an associative array // Note: If you’re expecting just one row, no need to use a loop // Note: If you put extract($row); inside the following loop, you’ll // … Read more