Giter Site home page Giter Site logo

googleworkspace / apps-script-samples Goto Github PK

View Code? Open in Web Editor NEW
4.3K 310.0 1.8K 2 MB

Apps Script samples for Google Workspace products.

Home Page: https://developers.google.com/apps-script

License: Apache License 2.0

JavaScript 85.21% HTML 14.28% Rust 0.51%
gsuite apps-script google-apps-script samples google-workspace classroom drive adminsdk calendar cloud

apps-script-samples's Introduction

Google Apps Script Samples

Various sample code and projects for the Google Apps Script platform, a JavaScript platform in the cloud.

Learn more at developers.google.com.

Google APIs

AdminSDK

Advanced Services

Calendar

Classroom

Data Studio

Docs

Drive

Forms

Gmail

People

Sheets

Slides

Tasks

Templates

  • Build off a working framework for new Apps Script projects.

Triggers

  • Call an Apps Script function such as onOpen, onEdit, or onInstall in an add-on
  • Create a time-driven trigger

Codelabs

Codelab tutorials combine detailed explanation, coding exercises, and documented best practices to help engineers get up to speed with key Google technologies. Here's a list of Apps Script codelabs:

Clone using the clasp command-line tool

Learn how to clone, pull, and push Apps Script projects on the command-line using clasp.

Lint

Run ESLint over this whole repository with:

npm run lint

This command will fix simple errors.

apps-script-samples's People

Contributors

asrivas avatar bcat avatar chanelgreco avatar clesleycode avatar cschalk-goog avatar deinspanjer avatar dependabot[bot] avatar diminishedprime avatar eesheesh avatar gkaldev avatar googleworkspace-bot avatar grant avatar hess-g avatar ikuleshov avatar jpoehnelt avatar jsmeredith avatar kar320 avatar kencenerelli avatar lastzactionhero avatar matheusbn avatar mcodik avatar minhaz avatar naokigoogle avatar oshliaer avatar paulirish avatar rajeshgogo avatar renovate[bot] avatar ryan-devrel avatar sqrrrl avatar vinay-google avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apps-script-samples's Issues

Error with appscript Cannot find method JSON.parse

So I have this small function that fetches JSON from our companys API and pushes it to Google sheets, everything was working ok yesterday but now when I run the script I get the error
"Cannot find function parse in [object Object] I have no idea where this is coming from since if I try to
write JSON. TAB it shows there is a parse function. Any thoughts? Is this a bug?

`function pullJSON() {
options = {muteHttpExceptions: true};
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheets = ss.getSheets();
var sheet = ss.getActiveSheet();

var url="API PATH"; // Paste your JSON URL here

var response = UrlFetchApp.fetch(url, options); // get feed
var dataAll = JSON.parse(response.getContentText()); //
var dataSet = dataAll;

var rows = [],
data;

for (i = 0; i < dataSet.length; i++) {
data = dataSet[i];
rows.push([data.title,new Date(data.promotionStartDate),new Date(data.promotionDateEnd)]); //your JSON entities here
}

dataRange = sheet.getRange(1, 1, rows.length, 3); // 3 Denotes total number of entites
dataRange.setValues(rows);
}
`

Gulp tasks not completing in order in import_export_development example

My team is attempting to implement the advanced dev process described on the Google dev blog.

As our code base has gotten larger, it seems that the tasks in our copy of your gulp.js file don't execute completely prior to being pushed up to the script file. So we end up with a partial copy of files in the actual script file, but a complete copy in the local build/env/src directory.

It seems that somehow the shell.task call is executing prior to the other tasks completing.

Thanks for these incredibly helpful examples!

Our gulp.js file:

'use strict';

var gulp = require('gulp');
var jshint = require('gulp-jshint');
var shell = require('gulp-shell');
var minimist = require('minimist');
var rename = require('gulp-rename');
var debug = require('gulp-debug');
var concat = require('gulp-concat');
var del = require('del');

// minimist structure and defaults for this task configuration
var knownOptions = {
  string: ['env'],
  'default': {
    env: 'dev'
  }
};
var options = minimist(process.argv.slice(2), knownOptions);

// The root working directory where code is edited
var srcRoot = 'src';
// The root staging folder for gapps configurations
var dstRoot = 'build/' + options.env + '/src';

// Runs the copy-latest task, then calls gapps upload in the correct
// configuration directory based on the target environment
gulp.task('upload-latest', ['copy-latest'], shell.task(['gapps upload'],
    {cwd: 'build/' + options.env}));

// Copies all files based on the current target environment.
// Completion of "clean-deployment" is a prerequisite for starting the copy
// process.
gulp.task('copy-latest', ['clean-deployment'], function() {
  copyEnvironmentSpecific();
  copyServerCode();
  copyClientCode();
});

// Copies all .js that will be run by the Apps Script runtime
function copyServerCode() {
  return gulp.src([
    srcRoot + '/libs/*.js',
    srcRoot + '/server/*.js',
    srcRoot + '/server/utils/*.js',
    srcRoot + '/server/models/*.js',
    srcRoot + '/server/utils/*.js',
    srcRoot + '/ui/*.server.js'])
      .pipe(gulp.dest(dstRoot));
}

// Appends ".html" to any css, and any js that will be included in client code
// Then copies those .html files to the upload staging folder.
function copyClientCode() {
  return gulp.src([
    srcRoot + '/ui/*.html',
    srcRoot + '/ui/*.css',
    srcRoot + '/ui/*.client.js',
    srcRoot + '/ui/services/*.client.js',
    srcRoot + '/ui/libs/*.client.js',
    srcRoot + '/ui/libs/*.css',
    srcRoot + '/ui/styles/*.css',
    srcRoot + '/ui/views/*.html',
    srcRoot + '/ui/controllers/*.client.js'])
      .pipe(
      rename(function(path) {
        if (path.extname !== '.html') {
          path.extname = path.extname + '.html';
        }
        return path;
      }))
      .pipe(gulp.dest(dstRoot));
}

// Does any environment specific work.
// the "lint" step is also here, as that is only done on "dev"
// targeted updates.
function copyEnvironmentSpecific() {
  // Do target environment specific work
  switch (options.env) {
    case 'dev':
      //Copy dev util scripts, if target is "dev"
      gulp.src(srcRoot + '/**/*.js')
          .pipe(jshint())
          .pipe(jshint.reporter('jshint-stylish'));
      break;

    default:
      break;
  }

  return gulp.src(srcRoot + '/environments/' + options.env + '/*.js')
      .pipe(gulp.dest(dstRoot));
}

// Utility tasks
gulp.task('clean-deployment', function(cb) {
  return del([
    dstRoot + '/*.*'
  ]);
});

gulp.task('clean-deployments', function(cb) {
  return del([
    'build/dev/src/*.*',
    'build/tst/src/*.*',
    'build/prd/src/*.*'
  ]);
});

gulp.task('lint', function() {
  return gulp.src(srcRoot + '/**/*.js')
      .pipe(jshint())
      .pipe(jshint.reporter('jshint-stylish'));
});

Date calculated wrong

Hi
I tried the dateadd function but found, strangely. that it sometimes calulates the dates wrongly.
In my A4 cell i have a (dutch format) date: 1-9-2017
In C4 I add: =DATEADD(A4; "M"; 1) this yields 1-10-2017
But in my E4 Cell i added =DATEADD(C4; "M"; 1). This yields 30-10-2017
Things get stranger because the next "hop" yields 1-12-2017 (correct) but the next 31-12-2017 (wrong)

I thought maybe the used library "Moment" has the problem, so I build a simple script to test this. However I cant reproduce the error from direct calls to the lib. I used the minified script that ships with the function (Moment.gs)

screenshot_20170902_113602

Am i missing something here?

Visible values are not currently supported

screenshot 4

var sheetID ="" //Enter your sheet ID
function test(){
var filterCriteria=SpreadsheetApp.newFilterCriteria().setVisibleValues(["Test"]).build();
SpreadsheetApp.setActiveSheet(SpreadsheetApp.openById(sheetID).getSheetByName("LP - Drives List"));
Logger.log(SpreadsheetApp.getActiveSheet().getName())
SpreadsheetApp.getActiveSheet().getRange(1,1,SpreadsheetApp.getActiveSheet().getLastRow(),SpreadsheetApp.getActiveSheet().getLastColumn()).createFilter().setColumnFilterCriteria(3, filterCriteria);
}

Break line in the message

Like, Suppose, if the user wants to break the line in the email body message? then how we could reconstruct this code?

My Email Response message is like below,

"Hello Dear Applicant,

You're registered with us, thank you for your interest

ABC Ltd."

Please Guide.

form input doesn't show correctly in IE 10

In IE10, the "Add" button doesn't show as a "submit" button but as text input.
In my own app, I have radio buttons and those also appear as text inputs.
It seems to me that HTMLService doesn't fully work on IE10.

simple_tasks

Forms Notifications sample doesn't support "collecting email addresses"

The app does not work with the new Google Forms and "collecting email addresses".

When you choose to send an email to the person that has submitted the form it only offers you the choice of selecting the other questions to find the email, not the email question created by Google with the collect email addresses option.

image

[wrong repo, but lost] `GmailApp.createDraft()` should allow optional arguments

Hello!

I think the arguments for the GmailApp.createDraft(recipient, subject, body) method should be optional.

Case in point: Linking composition to a "new message" button without context (as opposed to a contextual wholly programmatic strategy).

Example callback:

function composeEmailNewCallback(e) {
    Logger.log("Composing new draft.");
    return CardService.newComposeActionResponseBuilder()
        .setGmailDraft(GmailApp.createDraft("", "", ""))
        .build();
}

Clearly, the three zero length strings are needless for the programmer. GmailApp.createDraft() should suffice.

Thanks!

I know this is the wrong place, but I have no idea where this should be posted. Please let me know the correct place and then I'll delete and re-post elsewhere.

addGroupMember function - multiple groups

I am using App Maker to automate the creation of users in GSuite. This includes adding the user to multiple groups. I used the multi-select widget for selecting multiple groups but I get this error message in the console:

SEVERE: Modifying records: (Error) : Record update failed: 'Groups' field value must be a valid option, but found '[email protected],[email protected]'.

How can I use the admin SDK for multiple group selection?

Google Apps Script - Problems parsing JSON

Hi!

I am trying to update a GitHub json file from Google Apps Script (using UrlFetchApp.fetch() and I am getting the following error

{"message":"Problems parsing JSON","documentation_url":"https://developer.github.com/v3/repos/contents/#update-a-file"}

The parameters are the following:

var params = {
    "message": "This is  a test",
    "committer": {
      "name": "Daniel Deicide",
      "email": "[email protected]"
    },
    "content": "aGVsbG8sIHdvcmxkCg==", // this has to be Base64 encoded
    "sha": getSHA() //this is a function that returns sha of the file I want to update 
  };
    
  var options = {
    'method' : 'put',
    'payload' : params
  };

Could you please have a look and help me out with this?

Thank you!

There is some error

I tried both the demo instance and my own copy of Simple Tasks and both of them don't work for me in Firefox and Safari. I made sure the tasks API is enabled. It doesn't tell you what the error is but merely "An error has occurred, please try again".

Anyone else having this issue?

Video or Audio

How would you add some video or audio to Google Slides using the Google App Script?

Cannot get passed configuration

I am not sure what I am doing wrong. When I try to do anything from the Bibstro menu, I get taken to the "Initial Config" dialog. When I click update a new tab opens with "Oops! Google Chrome could not find e40f58b6-2e78-4d05-874a-b65355de03fc.foo.bar"

Not sure what to do......

Add ESLint

Current Errors:

gsuitedevs/apps-script-samples/advanced/adminSDK.gs
   20:1   error  Missing JSDoc comment                              require-jsdoc
   21:3   error  Split 'var' declarations into multiple statements  one-var
   27:27  error  Missing trailing comma                             comma-dangle
   47:1   error  Missing JSDoc comment                              require-jsdoc
   60:1   error  Missing JSDoc comment                              require-jsdoc
   65:26  error  Missing trailing comma                             comma-dangle
   68:41  error  Missing trailing comma                             comma-dangle
   79:1   error  Missing JSDoc comment                              require-jsdoc
   82:31  error  Missing trailing comma                             comma-dangle
   93:1   error  Missing JSDoc comment                              require-jsdoc
   94:3   error  Split 'var' declarations into multiple statements  one-var
   99:27  error  Missing trailing comma                             comma-dangle
  119:1   error  Missing JSDoc comment                              require-jsdoc
  124:19  error  Missing trailing comma                             comma-dangle
  137:1   error  Missing JSDoc comment                              require-jsdoc
  175:1   error  Missing JSDoc comment                              require-jsdoc
  187:1   error  Missing JSDoc comment                              require-jsdoc
  201:1   error  Missing JSDoc comment                              require-jsdoc
  204:3   error  Split 'var' declarations into multiple statements  one-var
  209:27  error  Missing trailing comma                             comma-dangle
  225:1   error  Missing JSDoc comment                              require-jsdoc
  230:15  error  There should be no space after '{'                 object-curly-spacing
  230:32  error  There should be no space before '}'                object-curly-spacing
  240:1   error  Missing JSDoc comment                              require-jsdoc
  247:3   error  Split 'var' declarations into multiple statements  one-var
  253:27  error  Missing trailing comma                             comma-dangle
  262:30  error  Missing trailing comma                             comma-dangle
  294:1   error  Missing JSDoc comment                              require-jsdoc
  303:20  error  Missing trailing comma                             comma-dangle
  306:3   error  Split 'var' declarations into multiple statements  one-var
  311:27  error  Missing trailing comma                             comma-dangle
  323:43  error  Missing trailing comma                             comma-dangle
  379:1   error  Missing JSDoc comment                              require-jsdoc
  380:3   error  Split 'var' declarations into multiple statements  one-var

gsuitedevs/apps-script-samples/advanced/adsense.gs
   17:1   error  Missing JSDoc comment                              require-jsdoc
   19:3   error  Split 'var' declarations into multiple statements  one-var
   23:27  error  Missing trailing comma                             comma-dangle
   42:1   error  Missing JSDoc comment                              require-jsdoc
   43:3   error  Split 'var' declarations into multiple statements  one-var
   47:27  error  Missing trailing comma                             comma-dangle
   65:1   error  Missing JSDoc comment                              require-jsdoc
   82:20  error  Missing trailing comma                             comma-dangle
  106:1   error  Missing JSDoc return type                          valid-jsdoc
  108:4   error  Missing JSDoc parameter type for 'parameter'       valid-jsdoc

gsuitedevs/apps-script-samples/advanced/analytics.gs
  17:1   error  Missing JSDoc comment             require-jsdoc
  32:1   error  Missing JSDoc comment             require-jsdoc
  48:1   error  Missing JSDoc comment             require-jsdoc
  68:1   error  Missing JSDoc comment             require-jsdoc
  77:16  error  Multiple spaces found before '='  no-multi-spaces
  83:22  error  Missing trailing comma            comma-dangle

gsuitedevs/apps-script-samples/advanced/appsActivity.gs
  21:1   error  Missing JSDoc comment   require-jsdoc
  30:29  error  Missing trailing comma  comma-dangle

gsuitedevs/apps-script-samples/advanced/bigquery.gs
   17:1   error  Missing JSDoc comment   require-jsdoc
   24:69  error  Missing trailing comma  comma-dangle
   41:40  error  Missing trailing comma  comma-dangle
   76:1   error  Missing JSDoc comment   require-jsdoc
   93:23  error  Missing trailing comma  comma-dangle
  100:40  error  Missing trailing comma  comma-dangle
  101:8   error  Missing trailing comma  comma-dangle
  102:6   error  Missing trailing comma  comma-dangle
  118:27  error  Missing trailing comma  comma-dangle
  120:27  error  Missing trailing comma  comma-dangle
  121:8   error  Missing trailing comma  comma-dangle
  122:6   error  Missing trailing comma  comma-dangle

gsuitedevs/apps-script-samples/advanced/calendar.gs
  20:1   error  Missing JSDoc comment                              require-jsdoc
  21:3   error  Split 'var' declarations into multiple statements  one-var
  25:27  error  Missing trailing comma                             comma-dangle
  44:1   error  Missing JSDoc comment                              require-jsdoc
  53:36  error  Missing trailing comma                             comma-dangle
  56:34  error  Missing trailing comma                             comma-dangle
  60:33  error  Missing trailing comma                             comma-dangle
  63:16  error  Missing trailing comma                             comma-dangle
  91:1   error  Missing JSDoc comment                              require-jsdoc
  98:19  error  Missing trailing comma                             comma-dangle

gsuitedevs/apps-script-samples/advanced/classroom.gs
  17:1   error  Missing JSDoc comment   require-jsdoc
  19:17  error  Missing trailing comma  comma-dangle

gsuitedevs/apps-script-samples/advanced/doubleclick.gs
  20:1   error  Missing JSDoc comment                              require-jsdoc
  40:1   error  Missing JSDoc comment                              require-jsdoc
  44:3   error  Split 'var' declarations into multiple statements  one-var
  49:29  error  Missing trailing comma                             comma-dangle
  68:1   error  Missing JSDoc comment                              require-jsdoc
  73:23  error  Missing trailing comma                             comma-dangle
  82:34  error  Missing trailing comma                             comma-dangle
  83:4   error  Missing semicolon                                  semi
  97:68  error  Missing trailing comma                             comma-dangle

gsuitedevs/apps-script-samples/advanced/drive.gs
  20:1   error  Missing JSDoc comment                              require-jsdoc
  24:26  error  Missing trailing comma                             comma-dangle
  35:1   error  Missing JSDoc comment                              require-jsdoc
  38:3   error  Split 'var' declarations into multiple statements  one-var
  43:27  error  Missing trailing comma                             comma-dangle
  65:1   error  Missing JSDoc comment                              require-jsdoc
  69:25  error  Missing trailing comma                             comma-dangle
  82:1   error  Missing JSDoc comment                              require-jsdoc

gsuitedevs/apps-script-samples/advanced/fusionTables.gs
  20:1   error  Missing JSDoc comment   require-jsdoc
  39:1   error  Missing JSDoc comment   require-jsdoc
  42:16  error  Missing trailing comma  comma-dangle

gsuitedevs/apps-script-samples/advanced/gmail.gs
  21:1   error  Missing JSDoc comment   require-jsdoc
  36:1   error  Missing JSDoc comment   require-jsdoc
  41:27  error  Missing trailing comma  comma-dangle
  60:1   error  Missing JSDoc comment   require-jsdoc
  65:20  error  Missing trailing comma  comma-dangle
  80:27  error  Missing trailing comma  comma-dangle

gsuitedevs/apps-script-samples/advanced/googlePlus.gs
  21:1   error  Missing JSDoc comment                              require-jsdoc
  23:3   error  Split 'var' declarations into multiple statements  one-var
  26:27  error  Missing trailing comma                             comma-dangle
  47:1   error  Missing JSDoc comment                              require-jsdoc
  49:3   error  Split 'var' declarations into multiple statements  one-var
  53:27  error  Missing trailing comma                             comma-dangle

gsuitedevs/apps-script-samples/advanced/googlePlusDomains.gs
  21:1   error  Missing JSDoc comment                              require-jsdoc
  37:1   error  Missing JSDoc comment                              require-jsdoc
  53:1   error  Missing JSDoc comment                              require-jsdoc
  55:3   error  Split 'var' declarations into multiple statements  one-var
  59:27  error  Missing trailing comma                             comma-dangle
  77:1   error  Missing JSDoc comment                              require-jsdoc
  81:7   error  Extra space after key 'originalContent'            key-spacing
  81:58  error  Missing trailing comma                             comma-dangle
  85:23  error  Missing trailing comma                             comma-dangle
  87:29  error  Missing trailing comma                             comma-dangle
  88:6   error  Missing trailing comma                             comma-dangle

gsuitedevs/apps-script-samples/advanced/mirror.gs
  20:1   error  Missing JSDoc comment   require-jsdoc
  41:1   error  Missing JSDoc comment   require-jsdoc
  45:73  error  Missing trailing comma  comma-dangle

gsuitedevs/apps-script-samples/advanced/prediction.gs
  17:1   error  Missing JSDoc comment   require-jsdoc
  28:42  error  Missing trailing comma  comma-dangle
  29:10  error  Missing trailing comma  comma-dangle
  41:42  error  Missing trailing comma  comma-dangle
  42:10  error  Missing trailing comma  comma-dangle
  52:1   error  Missing JSDoc comment   require-jsdoc
  63:49  error  Missing trailing comma  comma-dangle
  71:1   error  Missing JSDoc comment   require-jsdoc
  83:1   error  Missing JSDoc comment   require-jsdoc
  94:33  error  Missing trailing comma  comma-dangle
  95:12  error  Missing trailing comma  comma-dangle

gsuitedevs/apps-script-samples/advanced/sheets.gs
   16:21  error  Strings must use singlequote  quotes
   25:1   error  Missing JSDoc comment         require-jsdoc
   26:64  error  Strings must use singlequote  quotes
   35:1   error  Missing JSDoc comment         require-jsdoc
   38:6   error  Strings must use singlequote  quotes
   38:14  error  Strings must use singlequote  quotes
   38:23  error  Strings must use singlequote  quotes
   38:31  error  Strings must use singlequote  quotes
   38:40  error  Missing trailing comma        comma-dangle
   41:6   error  Strings must use singlequote  quotes
   41:14  error  Strings must use singlequote  quotes
   41:25  error  Strings must use singlequote  quotes
   42:6   error  Strings must use singlequote  quotes
   42:16  error  Strings must use singlequote  quotes
   42:21  error  Strings must use singlequote  quotes
   42:32  error  Missing trailing comma        comma-dangle
   46:5   error  Strings must use singlequote  quotes
   46:25  error  Strings must use singlequote  quotes
   47:5   error  Strings must use singlequote  quotes
   49:9   error  Strings must use singlequote  quotes
   49:18  error  Strings must use singlequote  quotes
   50:9   error  Strings must use singlequote  quotes
   50:27  error  Strings must use singlequote  quotes
   51:9   error  Strings must use singlequote  quotes
   51:32  error  Missing trailing comma        comma-dangle
   54:9   error  Strings must use singlequote  quotes
   54:18  error  Strings must use singlequote  quotes
   55:9   error  Strings must use singlequote  quotes
   55:27  error  Strings must use singlequote  quotes
   56:9   error  Strings must use singlequote  quotes
   56:28  error  Missing trailing comma        comma-dangle
   57:8   error  Missing trailing comma        comma-dangle
   58:6   error  Missing trailing comma        comma-dangle
   70:1   error  Missing JSDoc comment         require-jsdoc
   72:5   error  Strings must use singlequote  quotes
   73:7   error  Strings must use singlequote  quotes
   74:9   error  Strings must use singlequote  quotes
   74:18  error  Strings must use singlequote  quotes
   75:9   error  Strings must use singlequote  quotes
   76:11  error  Strings must use singlequote  quotes
   77:11  error  Strings must use singlequote  quotes
   77:28  error  Missing trailing comma        comma-dangle
   79:9   error  Strings must use singlequote  quotes
   80:11  error  Strings must use singlequote  quotes
   81:11  error  Strings must use singlequote  quotes
   82:11  error  Strings must use singlequote  quotes
   82:22  error  Missing trailing comma        comma-dangle
   83:10  error  Missing trailing comma        comma-dangle
   84:8   error  Missing trailing comma        comma-dangle
   85:6   error  Missing trailing comma        comma-dangle
   90:14  error  Strings must use singlequote  quotes
   99:1   error  Missing JSDoc comment         require-jsdoc
  102:5   error  Strings must use singlequote  quotes
  103:7   error  Strings must use singlequote  quotes
  104:9   error  Strings must use singlequote  quotes
  106:13  error  Strings must use singlequote  quotes
  107:15  error  Strings must use singlequote  quotes
  108:17  error  Strings must use singlequote  quotes
  109:17  error  Strings must use singlequote  quotes
  110:17  error  Strings must use singlequote  quotes
  111:17  error  Strings must use singlequote  quotes
  112:17  error  Strings must use singlequote  quotes
  112:36  error  Missing trailing comma        comma-dangle
  114:15  error  Strings must use singlequote  quotes
  116:19  error  Strings must use singlequote  quotes
  117:19  error  Strings must use singlequote  quotes
  118:19  error  Strings must use singlequote  quotes
  118:32  error  Strings must use singlequote  quotes
  119:19  error  Strings must use singlequote  quotes
  120:21  error  Strings must use singlequote  quotes
  122:25  error  Strings must use singlequote  quotes
  122:40  error  Strings must use singlequote  quotes
  122:46  error  Missing trailing comma        comma-dangle
  123:24  error  Missing trailing comma        comma-dangle
  124:22  error  Missing trailing comma        comma-dangle
  125:20  error  Missing trailing comma        comma-dangle
  128:19  error  Strings must use singlequote  quotes
  129:19  error  Strings must use singlequote  quotes
  130:19  error  Strings must use singlequote  quotes
  130:32  error  Strings must use singlequote  quotes
  131:19  error  Strings must use singlequote  quotes
  131:36  error  Missing trailing comma        comma-dangle
  132:18  error  Missing trailing comma        comma-dangle
  134:15  error  Strings must use singlequote  quotes
  136:19  error  Strings must use singlequote  quotes
  137:19  error  Strings must use singlequote  quotes
  137:32  error  Strings must use singlequote  quotes
  138:19  error  Strings must use singlequote  quotes
  139:19  error  Strings must use singlequote  quotes
  139:36  error  Missing trailing comma        comma-dangle
  140:18  error  Missing trailing comma        comma-dangle
  142:15  error  Strings must use singlequote  quotes
  144:19  error  Strings must use singlequote  quotes
  144:40  error  Strings must use singlequote  quotes
  145:19  error  Strings must use singlequote  quotes
  145:42  error  Missing trailing comma        comma-dangle
  146:18  error  Missing trailing comma        comma-dangle
  148:15  error  Strings must use singlequote  quotes
  148:30  error  Strings must use singlequote  quotes
  148:42  error  Missing trailing comma        comma-dangle
  149:14  error  Missing trailing comma        comma-dangle
  150:12  error  Missing trailing comma        comma-dangle
  151:10  error  Missing trailing comma        comma-dangle
  153:7   error  Strings must use singlequote  quotes
  154:9   error  Strings must use singlequote  quotes
  155:9   error  Strings must use singlequote  quotes
  156:9   error  Strings must use singlequote  quotes
  156:25  error  Missing trailing comma        comma-dangle
  158:7   error  Strings must use singlequote  quotes
  158:17  error  Strings must use singlequote  quotes
  158:29  error  Missing trailing comma        comma-dangle
  159:6   error  Missing trailing comma        comma-dangle

gsuitedevs/apps-script-samples/advanced/shoppingContent.gs
   17:1   error  Missing JSDoc comment   require-jsdoc
   36:24  error  Missing trailing comma  comma-dangle
   43:26  error  Missing trailing comma  comma-dangle
   44:8   error  Missing trailing comma  comma-dangle
   48:23  error  Missing trailing comma  comma-dangle
   49:6   error  Missing trailing comma  comma-dangle
   58:1   error  Missing JSDoc comment   require-jsdoc
   68:29  error  Missing trailing comma  comma-dangle
   86:1   error  Missing JSDoc comment   require-jsdoc
   95:36  error  Missing trailing comma  comma-dangle
  102:36  error  Missing trailing comma  comma-dangle
  109:36  error  Missing trailing comma  comma-dangle
  110:8   error  Missing trailing comma  comma-dangle
  111:6   error  Missing trailing comma  comma-dangle
  121:1   error  Missing JSDoc comment   require-jsdoc
  138:24  error  Missing trailing comma  comma-dangle
  143:24  error  Missing trailing comma  comma-dangle
  149:24  error  Missing trailing comma  comma-dangle
  150:8   error  Missing trailing comma  comma-dangle
  151:6   error  Missing trailing comma  comma-dangle

gsuitedevs/apps-script-samples/advanced/slides.gs
   16:22  error  Strings must use singlequote  quotes
   17:14  error  Strings must use singlequote  quotes
   18:15  error  Strings must use singlequote  quotes
   24:1   error  Missing JSDoc comment         require-jsdoc
   26:36  error  Strings must use singlequote  quotes
   26:45  error  Strings must use singlequote  quotes
   27:14  error  Strings must use singlequote  quotes
   35:1   error  Missing JSDoc comment         require-jsdoc
   40:5   error  Strings must use singlequote  quotes
   41:7   error  Strings must use singlequote  quotes
   42:7   error  Strings must use singlequote  quotes
   43:7   error  Strings must use singlequote  quotes
   44:9   error  Strings must use singlequote  quotes
   44:29  error  Strings must use singlequote  quotes
   44:52  error  Missing trailing comma        comma-dangle
   45:8   error  Missing trailing comma        comma-dangle
   46:6   error  Missing trailing comma        comma-dangle
   50:14  error  Strings must use singlequote  quotes
   58:1   error  Missing JSDoc comment         require-jsdoc
   62:32  error  Strings must use singlequote  quotes
   62:42  error  Strings must use singlequote  quotes
   71:1   error  Missing JSDoc comment         require-jsdoc
   77:5   error  Strings must use singlequote  quotes
   78:7   error  Strings must use singlequote  quotes
   79:7   error  Strings must use singlequote  quotes
   79:20  error  Strings must use singlequote  quotes
   80:7   error  Strings must use singlequote  quotes
   81:9   error  Strings must use singlequote  quotes
   82:9   error  Strings must use singlequote  quotes
   83:11  error  Strings must use singlequote  quotes
   84:13  error  Strings must use singlequote  quotes
   85:13  error  Strings must use singlequote  quotes
   85:21  error  Strings must use singlequote  quotes
   85:25  error  Missing trailing comma        comma-dangle
   87:11  error  Strings must use singlequote  quotes
   88:13  error  Strings must use singlequote  quotes
   89:13  error  Strings must use singlequote  quotes
   89:21  error  Strings must use singlequote  quotes
   89:25  error  Missing trailing comma        comma-dangle
   90:12  error  Missing trailing comma        comma-dangle
   92:9   error  Strings must use singlequote  quotes
   93:11  error  Strings must use singlequote  quotes
   94:11  error  Strings must use singlequote  quotes
   95:11  error  Strings must use singlequote  quotes
   96:11  error  Strings must use singlequote  quotes
   97:11  error  Strings must use singlequote  quotes
   97:19  error  Strings must use singlequote  quotes
   97:23  error  Missing trailing comma        comma-dangle
   98:10  error  Missing trailing comma        comma-dangle
   99:8   error  Missing trailing comma        comma-dangle
  100:6   error  Missing trailing comma        comma-dangle
  102:5   error  Strings must use singlequote  quotes
  103:7   error  Strings must use singlequote  quotes
  104:7   error  Strings must use singlequote  quotes
  104:15  error  Strings must use singlequote  quotes
  105:7   error  Strings must use singlequote  quotes
  105:26  error  Missing trailing comma        comma-dangle
  106:6   error  Missing trailing comma        comma-dangle
  110:14  error  Strings must use singlequote  quotes
  119:1   error  Missing JSDoc comment         require-jsdoc
  121:5   error  Strings must use singlequote  quotes
  122:7   error  Strings must use singlequote  quotes
  123:7   error  Strings must use singlequote  quotes
  123:17  error  Strings must use singlequote  quotes
  124:7   error  Strings must use singlequote  quotes
  125:9   error  Strings must use singlequote  quotes
  126:11  error  Strings must use singlequote  quotes
  127:13  error  Strings must use singlequote  quotes
  127:27  error  Strings must use singlequote  quotes
  127:36  error  Missing trailing comma        comma-dangle
  128:12  error  Missing trailing comma        comma-dangle
  130:9   error  Strings must use singlequote  quotes
  131:9   error  Strings must use singlequote  quotes
  132:9   error  Strings must use singlequote  quotes
  133:9   error  Strings must use singlequote  quotes
  133:23  error  Strings must use singlequote  quotes
  134:9   error  Strings must use singlequote  quotes
  135:11  error  Strings must use singlequote  quotes
  136:11  error  Strings must use singlequote  quotes
  136:19  error  Strings must use singlequote  quotes
  136:23  error  Missing trailing comma        comma-dangle
  137:10  error  Missing trailing comma        comma-dangle
  139:7   error  Strings must use singlequote  quotes
  140:9   error  Strings must use singlequote  quotes
  140:17  error  Strings must use singlequote  quotes
  140:22  error  Missing trailing comma        comma-dangle
  141:8   error  Missing trailing comma        comma-dangle
  142:6   error  Missing trailing comma        comma-dangle

gsuitedevs/apps-script-samples/advanced/tagManager.gs
   17:1   error  Missing JSDoc @return for function         valid-jsdoc
   17:1   error  Missing JSDoc for parameter 'accountPath'  valid-jsdoc
   28:32  error  Missing trailing comma                     comma-dangle
   55:29  error  Missing trailing comma                     comma-dangle
   57:71  error  Missing trailing comma                     comma-dangle
   59:47  error  Missing trailing comma                     comma-dangle
   73:1   error  Missing JSDoc for parameter 'versionPath'  valid-jsdoc
   73:1   error  Missing JSDoc @return for function         valid-jsdoc
   75:41  error  Missing semicolon                          semi
   79:1   error  Missing JSDoc for parameter 'version'      valid-jsdoc
   99:1   error  Missing JSDoc @return for function         valid-jsdoc
   99:1   error  Missing JSDoc for parameter 'versionPath'  valid-jsdoc
  101:41  error  Missing semicolon                          semi
  105:1   error  Missing JSDoc for parameter 'version'      valid-jsdoc
  111:54  error  Missing semicolon                          semi
  117:57  error  Missing trailing comma                     comma-dangle
  128:1   error  Missing JSDoc for parameter 'accountPath'  valid-jsdoc

gsuitedevs/apps-script-samples/advanced/tasks.gs
  17:1   error  Missing JSDoc comment   require-jsdoc
  32:1   error  Missing JSDoc comment   require-jsdoc
  47:1   error  Missing JSDoc comment   require-jsdoc
  50:40  error  Missing trailing comma  comma-dangle

gsuitedevs/apps-script-samples/advanced/urlShortener.gs
  17:1   error  Missing JSDoc comment   require-jsdoc
  19:38  error  Missing trailing comma  comma-dangle
  26:1   error  Missing JSDoc comment   require-jsdoc
  28:35  error  Missing trailing comma  comma-dangle

gsuitedevs/apps-script-samples/advanced/youtube.gs
  24:1   error  Missing JSDoc comment                    require-jsdoc
  27:19  error  Missing trailing comma                   comma-dangle
  46:1   error  Missing JSDoc comment                    require-jsdoc
  48:15  error  Missing trailing comma                   comma-dangle
  63:33  error  Missing trailing comma                   comma-dangle
  72:7   error  Block must not be padded by blank lines  padded-blocks
  83:1   error  Missing JSDoc comment                    require-jsdoc
  91:29  error  Missing trailing comma                   comma-dangle
  92:8   error  Missing trailing comma                   comma-dangle
  93:6   error  Missing trailing comma                   comma-dangle

gsuitedevs/apps-script-samples/advanced/youtubeAnalytics.gs
  21:1   error  Missing JSDoc comment   require-jsdoc
  24:15  error  Missing trailing comma  comma-dangle
  38:24  error  Missing trailing comma  comma-dangle
  42:16  error  Missing trailing comma  comma-dangle
  74:1   error  Missing JSDoc comment   require-jsdoc
  82:1   error  Missing JSDoc comment   require-jsdoc

gsuitedevs/apps-script-samples/advanced/youtubeContentId.gs
  21:1   error  Missing JSDoc comment   require-jsdoc
  55:1   error  Missing JSDoc comment   require-jsdoc
  67:15  error  Missing trailing comma  comma-dangle
  68:10  error  Missing trailing comma  comma-dangle
  69:8   error  Missing trailing comma  comma-dangle
  70:6   error  Missing trailing comma  comma-dangle
  88:1   error  Missing JSDoc comment   require-jsdoc
  94:25  error  Missing trailing comma  comma-dangle

✖ 402 problems (402 errors, 0 warnings)
  298 errors, 0 warnings potentially fixable with the `--fix` option.

Error "Invalid field selection files" in Drive quickstart

I consistently get an error of

Invalid field selection files (line 22, file "Code")

At the top of the screen when I attempt to run the Quickstart sample from QuickStart Example.

What (obvious) thing am I doing wrong? Or is the Quickstart example wrong?

/**

  • Copyright Google LLC
  • Licensed under the Apache License, Version 2.0 (the "License");
  • you may not use this file except in compliance with the License.
  • You may obtain a copy of the License at
  • https://www.apache.org/licenses/LICENSE-2.0
    
  • Unless required by applicable law or agreed to in writing, software
  • distributed under the License is distributed on an "AS IS" BASIS,
  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  • See the License for the specific language governing permissions and
  • limitations under the License.
    /
    // [START drive_quickstart]
    /
    *
  • Lists the names and IDs of up to 10 files.
    */
    function listFiles() {
    Logger.log('Entering listFiles function....');
    var files = Drive.Files.list({
    fields: 'nextPageToken, files(id, name)',
    pageSize: 10
    }).files;
    for (var i = 0; i < files.length; i++) {
    var file = files[i];
    Logger.log('%s (%s)', file.name, file.id);
    }
    }
    // [END drive_quickstart]

Google Form API ( getValidtors of an item)

Hi,

Is there a way to get the current validations I assigned on a item?
Example:
let form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');
let item = form.addTextItem();
.......
.......
let validations = item.getValidations();

The helloworld script doesn't run?

Mine doesn't run and says "Server error occurred. Please try saving the project again [Dismiss]" on three different Google accounts. So am I doing something wrong or is it the script?
Thank you.

Sample uses undocumented API

Expected Behavior

When installing @types/google-apps-script, I expect all samples to run without problem.
Sample URL: https://github.com/gsuitedevs/apps-script-samples/blob/master/advanced/calendar.gs#L66
Description: This line uses APIs not published by google-apps-script, or the Calendar class.

Actual Behavior

Either don't use internal APIs in public examples, or document the API in public docs.

Steps to Reproduce the Problem

  1. Compare between @types/google-apps-script/google-apps-script.calendar.d.ts and the aforementioned link.

Can we get the results with different user names in query - G suite admin sdk Directory API - users.list API

Expected Behavior

Want to get the results with for name John , Adam, Rohan at a once with (multiple names at once to api).

Sample URL:
trying with this api

https://developers.google.com/admin-sdk/directory/v1/reference/users/list

https://developers.google.com/admin-sdk/directory/v1/guides/search-users?update_high_contrast=true&authuser=0
Description:

  1. Im able to give single query clause for search users for example query=name:John*
  2. query=name:'hari*' email:'hari*' (tried this both name and email fields it worked)

AS per the docs multiple clauses should work.
But as per my requirement trying with multiple names with query
query=name:John* name:Rohan* name:Adam*
it didn't help me out.

Do I need to make this API call for each users or can I use query field to get different usrs at once with API

Actual Behavior

query=name:John* (with Single user name is working)
Need to get the results of different users at once with API.

Steps to Reproduce the Problem

  1. https://developers.google.com/admin-sdk/directory/v1/reference/users/list
  2. query=name:John* (this worked)
  3. query=name:John* name:Rohan* name:Adam* (Want to get different users data with query)
  4. Passing the query like this in above url

Documented functional parameters of wrong type

Hi

When I am going through the app-script-samples I found an issue that documentation of functional parameters are of Wrong type. Prefer refer to this link for reference to make it more sense.

and the same wrong parameters are mentioned in the main site too. Please refer this guides link.

image

No result or error when running sample drive script

Hi.

When running the following Quick Start script...

 /**
 * Lists the names and IDs of up to 10 files.
 */
function listFiles() {
  var files = Drive.Files.list({
    fields: 'nextPageToken, items(id, title)',
    maxResults: 10
  }).items;
  for (var i = 0; i < files.length; i++) {
    var file = files[i];
    Logger.log('%s (%s)', file.title, file.id);
  }
}

...nothing happens. I've enabled the API and sorted out credentials, but when running this script it pops up along the top "Running function listFiles..." and then disappears.

This is all new to me. I was hoping to learn how to do other functions but I'm hesitant to go further if I can't get the stock script to run.

Any advice would be appreciated.

Missing File upload Item in Class Form

I'm sorry if this isn't the right place for this, but I couldn't find anything in the reference regarding File upload item in the reference documentation. I am able to add a file upload field from the GUI but there isn't anything equivalent for apps script, Is this not implemented yet?

Add Travis

  • Add the badge to the README
  • Set up for linting.

Use of Polymer and material design in the code samples

Hey, first off, thanks for the sample code. They were really helpful 👍

In the guides for publishing an add on there are general rules:
image

In the demo scripts supplied you use both. From the Readme.md:
image

Is it not strictly enforced, or that this is a decision that's changing in the future as more of the Google apps move towards Material design? The reason I ask is because I've been building a Sheets sidebar addon using ionic components for the UI and I'm starting to wonder if it will be accepted given the UI guide?

eg (Note this was just to test if would could get ionics main components running and isn't the app, the add in does salesforce reporting integration, query editing simillar to pivot tables, etc):
ionic_in_google_sheets_full_demo

#Error! Issue

Google sheets returns inconsistent error when using this script.
Here is my formula (In the F column)
=IF(ISBLANK(E2),"",DATESUBTRACT(DATEADD(E2,"Years",3),"Days",1))

E2 is a date such as 4/29/2015

For some cells this works, for others it does not. (See attachment)
Refreshing the page allows some others to calculate properly, and others to stop working properly.
Occasionally, if I add another column, everything in the F Column calculates properly.

The full error message:
"Invalid content
Error
Parameter 1 expects a date value, but "#ERROR!" cannot be coerced to a date. (line 116)."

image

iOS - GTL.framework not properly added

I have followed all the steps given in iOS Quickstart but it fails to find framework. Is there a way I can download framework as zip file and just drag and drop to project folder instead of doing a git way?

OS : OSX 10.11.1
Xcode : 7.2 ((7C68))

screen shot 2016-02-02 at 12 58 19 pm

Disable trailing commas

The Apps Script IDE/editor doesn't indent properly when there are trailing commas for object key/value pairs. Although, the runtime executes the code correctly.

Given this IDE limitation, it would be best for trailing commas to be explicitly removed from every sample.

Proposal

Add this rule to our .eslintrc.js (https://eslint.org/docs/rules/comma-dangle)

"comma-dangle": "never"

Run a standalone code with library dependencies that calls a remote spreadsheet? (need an example...)

Hello, thank you for the great work, and sorry for my basic question.

Here is my scenario:

  • I have a standalone MyLibrary.gs saved as a library, and configured with node-google-apps-script
  • which itself depends from other libraries (cheerio-gasify for example)
  • and i want to test my code from the node cli
  • on a remote spreadsheet that calls my library

Is it possible ?
and how can i make it work?

A working example would be great.

Thanks!

wrong code

I have error:
ReferenceError: "Drive" is not defined. (line 40, file "Code")

in this line:
folders = Drive.Files.list({

"Calendar" is not defined. (line 29"

ReferenceError: "Calendar" is not defined. (line 29, file "calendar test")

Copy/pasted code "as is" into new project. Received above error. This is on a personal Google account, not corporate, so don't know if that is affecting anything.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.