Stream

Join this community to post or comment

Gabriel Fantana

Problem/Coding Help  - 
 
Hello, how can I display a private google group RSS feed into a google site? Both are under the same domain. The RSS gadget works only with public google groups. I found something (link below) and I don't know how to insert it into my google site. Thank you much! 
1
Add a comment...

Benjamin Reich

Problem/Coding Help  - 
 
Ideally, the backend service supporting my add-on should have offline access, in order to place files on a user's Drive when the files are being created.

I know I can do this via the OAuth2 library, but this then requires a second authorization screen during the initial installation/registration process.

Is there any way to get a refresh token for a user directly via GAS code during the initial installation/authorization flow, so all authorization can be done via a single screen?  Have I missed something?
1
Add a comment...

Jasper Groot

Problem/Coding Help  - 
 
Hi everyone,

I've created an addon for a spreadsheet (non-doplyed, created by going to tools -> script editor) through which the user can run functions through a menu. However, when a user tries to run a function, it tells them that they don't have the permission to, most likely because they don't have access to the script of which I cannot change the sharing settings. This spreadsheet/addon was created on a different user than my own account, and on my own account I don't have any trouble running the script.

This has happened before, and it solved itself after a certain amount of time, but what could be causing this and why is my own account exempt from this problem. I shared it in the same way to my account as I did to the others and my account isn't in any way connected to the other account.
1
Willem Karssenberg's profile photo
 
I cannot answer your question, unless you give me access to that script...
Add a comment...

Kyle Upton

Problem/Coding Help  - 
 
I have a Google Apps Script that runs with a Google Sheet. It saves data entered from an html dialog with a success and failure handler to let the user know whether it was successful, then it goes on to use the newly saved data on the sheet to update 3 different google docs, again with handlers to keep the user in the loop. I have 3 users that have been using the system for months with no problems. Bringing 2 new staff onboard - for the first, the save script finishes, but the handler returns a failure. For the second new user, the save completes, the first two docs updates go through, but then the third throws a failure. Message I'm getting is " Execution failed: We're sorry, a server error occurred. Please wait a bit and try again."

As far as I can tell user permissions are the same, same computer, same program and script.

Don't know where to start trying to fix it....help?
1
Kyle Upton's profile photoA. Luca B's profile photo
4 comments
 
It smells like a concurrency issue. Are you using Locks to stop execution in criticsl points?
Add a comment...

Pramil Liyanage

Problem/Coding Help  - 
 
Is it possible to protect a sheet from the current user after he/she finishes entering data and clicking a menu item in a Google sheet?
3
Marcos Gomes's profile photoPramil Liyanage's profile photo
4 comments
 
+Neha Gaba
I tried with class protection but there the current user cannot be blocked. I need to protect from the current user and keep only the owner.
Add a comment...

Santi Khairassame

Problem/Coding Help  - 
 
Dear Google Gurus,

I have a Google Form using a standard grid question format with radio buttons. I am interested in turning those radio buttons into checkboxes so users can select more than one option in the grid.

Does anyone know of a script or add-on that that can enable this?

Thank you very much in advance,
Santi
1
Riël Notermans's profile photoMark Schuurman's profile photo
4 comments
 
Only solution would be to split every row of the initial question into a checkbox item and offer the selectable items over and over again on each question. 
Add a comment...

Koen van Wielink

Problem/Coding Help  - 
 
Hi Everyone,

We recently developed a form with some apps script in the background to handle our travel requests. The Sheet with the responses contains a few triggers which send out email alerts.
The documents were created under a central systems account, but development is done under our developer's user accounts. However, right now we can only see the triggers when we login under the owner's account, not when we login under any of the collaborator accounts. According to one of the team members, in the past they were able to see the triggers under their collaborator accounts.
Does anyone have any idea why this is happening? We run the risk of duplicating triggers, or missing existing ones.
Thanks.
3
1
Riël Notermans's profile photoKoen van Wielink's profile photo
6 comments
 
Thanks for the tip!
Add a comment...

Simon Triva

Problem/Coding Help  - 
 
Hello,

I have problem how to copy data (with script) from one sheet to another sheet in different spreadshhet. 
Please help
1
Simon Triva's profile photoMSG Jeffery Crane's profile photo
4 comments
 
function copyData()
{
//To execute this properly, copy this entire code, starting with row one, into the spreadsheet you are copying the data FROM (source). In the source click Tools/Script Editor and select "Blank Project". Paste, save, and run the code.

//Specifies source spreadsheet criteria
var source = SpreadsheetApp.getActiveSpreadsheet();//Defines the source spreadsheet, in this example, the source is the current spreadsheet.
var source_sheet = source.getSheetByName("Unit FY Data Import");//Enter the name between the quotes of the sheet within the specified source spreadsheet that holds the data you want to transfer
var lastRow = source_sheet.getLastRow();//For checking last row with data in cell and formatting range
var source_range = source_sheet.getRange(1,1,lastRow,41);//(StartRow,StartColumn,NumberofRowstoGet,NumberofColumnstoGet)

//Specifies target spreadsheet criteria
var target = SpreadsheetApp.getActiveSpreadsheet();//Defines the target spreadsheet, in this example, the target is the current spreadsheet. Replace .getActiveSpreadsheet with .openById("sheet id in URL") if you want to copy data to another spreadsheet
var target_sheet = target.getSheetByName("Unit FY Data");//Enter the name between the quotes of the sheet within the specified source spreadsheet you want the data to be written to
var target_range = target_sheet.getRange(1,1,lastRow,41);//(StartRow,StartColumn,NumberofRowstoPost,NumberofColumnstoPost) Use the array size to define the range because the target column A is not necessarily the same size at this time.

//Fetch values
var values = source_range.getValues();
//Write values to target
target_range.setValues(values);

//Remember to go to Resources, Current Project's Triggers and set triggers to notify you if this code fails, and to also set a trigger if you want it to execute automatically when a condition is met

}

Add a comment...

Chuck Grigsby

Problem/Coding Help  - 
 
On my addon I have a button that clears all the highlights on the page. The issue is for bullet lists that are highlighted like this (From hitting "Enter" and going to a new line) do not clear. Below is my code I'm using to clear highlights. Thanks everyone!

function clearHighlights(){
 
var body = DocumentApp.getActiveDocument().getBody();
var text = body.editAsText();
  if (text.getText().length != 0){
  text.setBackgroundColor(0, text.getText().length - 1, '#FFFFFF')
  }else{
    DocumentApp.getUi().alert('There is nothing to clear');
  }
}
1
Benjamin Reich's profile photoChuck Grigsby's profile photo
2 comments
 
Done! Thanks!
Add a comment...

Rajiv Goswami

Problem/Coding Help  - 
 
Im having issues with my app script. I have been using this from months ow. It was working fine. Suddenly, now when I search in script column height increases dramatically. Lease see my script below 
1
Martin Hawksey's profile photoRajiv Goswami's profile photo
8 comments
 
Yeap... This helped... Thanks 
Add a comment...

Katie Regan

Problem/Coding Help  - 
 
Does anyone know if there is a script I can use to create a bunch of spreadsheets quickly with a list of filenames? Just something very simple. I dont need them linked to anything but may want to use them for the pushData add-on. +Jay Atwood +Andrew Stillman +Bjorn Behrendt 
1
Katie Regan's profile photo
4 comments
 
Form Router is gone! I have sheetSpider set up and my form responses go there. I want a new file for each teacher, but I also want a separate file system for each building, using the same data in the form responses sheet, but pushed differently. Any ideas? +Andrew Stillman +Bjorn Behrendt +Spencer Easton +Jay Atwood 
Add a comment...

Kyle Upton

Problem/Coding Help  - 
 
How to prevent Google Apps Script using the wrong Script Project?

I have an html dialog for Sheets that is used for input and saving of customer data. I made a copy of it for use in a different office, so now I have Worksheet#1 with Script project "Scripts" and Copy of Worksheet#1 with Script project "Copy of Scripts". So the individual script files in each project have the same names. We've made changes to Scripts so it is no longer the same as Copy of Scripts.
Sometimes Worksheet#1 triggers scripts that are in Copy of Scripts. Not sure why. On these occasions I can open up script editor and it asks which project to open (Scripts or Copy or Scripts) and once I select the right one it behaves properly until the next time this happens.

How can I insure that it always opens the correct project?
1
Martin Hawksey's profile photoKyle Upton's profile photo
4 comments
 
Copy of Scripts somehow became attached to Worksheet#1 as well, so I could open up script editor>File>Open and see the 2 projects, then just deleted the one I didn't want. I was worried that this would delete the Copy of Scripts in Worksheet#2 as well, but no, they are independent. Thanks
Add a comment...

Nazmus Sakib

Problem/Coding Help  - 
 
I have created a Zap using Zapier. It inserts a new row in Google sheet when a new email is received in mailparser.io inbox. I want my Google Script to trigger immediately when Zapier inserts the new row. onChange(e) works fine when user inserts a new row but it does not trigger when Zapier inserts the row. Anyone have any idea?
1
Nazmus Sakib's profile photoSpencer Easton's profile photo
6 comments
 
Under choose an action app there is an option Webhook by Zapier. You can choose GET or POST. Look at the doGet and doPost apis here:
https://developers.google.com/apps-script/guides/triggers/#doget_and_dopost
Add a comment...

scott taggart

Problem/Coding Help  - 
 
I am having a strange issue regarding in which row of a linked sheet a google form places a new form row.  Normally, each form submit adds a row to the sheet, starting with row 2 (row 1 is the header), as expected.  If I delete all the rows in the sheet, form submits restart at row 2, as expected.  But, now suppose I manually populate say the first 10 rows of the form (again, leaving row 1 as the header, so rows 2-11).  Now when I do a form submit, I would expect row 12 to be added to and so on but instead, form starts at row 2 and wipes out my pre-populated row data.  It seems that the form and the sheet have an internal "next row number" that is not based on the actual contents of the sheet.  Can anyone shed any light one this?
1
scott taggart's profile photoNazmus Sakib's profile photo
3 comments
 
Go to the Form so you can edit it. In "Responses" menu you will see "Delete All Responses".
Add a comment...

Riël Notermans
moderator

Problem/Coding Help  - 
 
CORS and sending content to external services. Why does UrlFetchApp have no problems with CORS?

When using URL FetchApp to post content to a service, we run into limits of contentsize. The 100Mb daily limit is very very tight (this is scanned documents that need to get uploaded) so we need to find an alternative. In HTmlService we are able to send them via jQuery / ajax, but then we get a CORS error in the browser.

why does it work with UrlFetchApp and not via the browser?
1
Spencer Easton's profile photoRiël Notermans's profile photo
5 comments
 
Thank you +Benjamin Reich  .Good to know the details. But, most often, we are programming Apps Script to quite conservative, on premise systems that do not like fiddling :)

As this one. Changing that is hard. 
Add a comment...

Chloë Boulez

Problem/Coding Help  - 
 
I need a custom integration with Google software. I need to be able to use my custom form with over 80 conditions to draw data into google contacts and create events with google calendar, all on the backend. I am NOT looking for a solution for clients to book themselves.

Help! Nobody seems to offer the specific service I need to grow my business.

help!
3
Chloë Boulez's profile photoEdouard Brasier's profile photo
10 comments
 
Good so you should choose me because I am French : ) Your need is a bit general, if you send me a more precise example by email at ed@digital-consolidation.co.uk then I will have a better look.
Add a comment...

Massimo Coletti

Problem/Coding Help  - 
 
Lookingat documentation, it appears that a Script is not allowed to create a Google Plus post, unless you work in a domain. I have a Business Account, and I was successful creating posts with GAS, but the same script doesn't work with my private account, even changing few parameters.
2
1
Massimo Coletti's profile photoWeb Apps R&D's profile photo
2 comments
 
My use case was an html form, issued by a web app script, that gather some data from the user and publish a post with this data. Then I was thinking to develop another app to search posts based on hashtags: the user may input an hashtag, see a result list, and a second list with the other hashtags related with the first searched.
I can obtain the same result using +Evernote​ or other services to publish posts. G+ offers the advantage that the search results may include also posts from others, with the same hashtag.
Add a comment...

scott taggart

Problem/Coding Help  - 
 
Is it possible to use GAS to create fusion table views and, optionally with filter settings?  I need to enumerate the columns of the FT (which I know how to do) and create different views and ideally, I need to get their URLs too.  Thanks.
1
scott taggart's profile photo
4 comments
 
OK, found the zero rowid problem - my sheet I was importing from had a column with that same name and it had all zeroes!!  opps.
Add a comment...

scott taggart

Problem/Coding Help  - 
 
I have a GAS  running in a sheet that I want to periodically delete all rows in my Fusion Table that are older than N days.  I tried the expected sql statements and get errors ("parser error near date_time field").  After a bit of research, I see here: https://code.google.com/p/fusion-tables/issues/detail?id=863 that deleting rows was/is? not supported.  Can anyone update me on if this is still true and point me to possible docs or examples on how to selectively delete rows based on a date column via GAS.  Or tell me I am screwed if that is the case.  Thanks.
Fusion Tables Issue Tracker
1
scott taggart's profile photoAnees Hameed's profile photo
13 comments
 
Not sure about the link, but it is 30 r/w per minute. There is also size restriction which is 1 gb of data per account with max 250 mb per table. I didn't find any documentation on deleting multiple rows in single query. You will have to put this in a loop instead. Basically idea behind fusion is not a data storage Sql table, but its main purpose is to combine data from different tables and create new visualisation from the combined data in a hassle free way, so restrictions like 30 rw/min, single read write operations are just okey. If you are looking for a data storage with huge number of read write and bigger database, then its better you switch to Mongo now!
Add a comment...

Ricardo Bagnoli

Problem/Coding Help  - 
 
does anyone know how to programmatically create a filter view for populated data in spreadsheet? this is my code:

function onOpen()
{
  cleanSheet();
  buildMenu();
  GET_google_Test();
}
function buildMenu()
{
  var spreadsheet = SpreadsheetApp.getActive();
  var menuItems = [{name: 'get updated data...', functionName: 'GET_google_Test'}];
  spreadsheet.addMenu('Get data', menuItems);
}
function cleanSheet()
{
  //link for documentation: https://developers.google.com/apps-script/reference/spreadsheet/sheet#clear()   var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getSheets()[0];
  sheet.clear({ formatOnly: true, contentsOnly: true });
}
function GET_google_Test()
{
 

  var conn = Jdbc.getConnection("jdbc:sqlserver://xxxxxxxx;" + "databaseName=xxx;user=xx;password=xxxxxxx;");
    var stmt = conn.createStatement();
    var start = new Date();

  var sw = 0;
  var str_value1 = '2013';
  var str_value2 = '2017';
  
  var rs = stmt.executeQuery("exec GET_google_Test " + sw + "," + str_value1 + "," + str_value2);
  var doc = SpreadsheetApp.getActiveSpreadsheet();
  var cellx = doc.getRange('a2');
  var cell = doc.getRange('a3');
  var row = 0;
   
  while (rs.next())
  {
    for (var col = 0; col < rs.getMetaData().getColumnCount(); col++)
    {
      if (row == 0)
      {
        cellx.offset(row, col).setBackground("royalblue");
        cellx.offset(row, col).setFontColor("white");
        cellx.offset(row, col).setFontSize(12);
        cellx.offset(row, col).setFontWeight("bold");
        cellx.offset(row, col).setWrap(true);
        cellx.offset(row, col).setValue(rs.getMetaData().getColumnName(col + 1));
      }
     
      cell.offset(row, col).setWrap(true);
      cell.offset(row, col).setValue(rs.getString(col + 1));
     
    }
   
    row++;
  }
 
  rs.close();
  stmt.close();
  conn.close();
 
  var end = new Date();
  Logger.log("time took: " + (end.getTime() - start.getTime()));
}
1
1
Anees Hameed's profile photo김진달's profile photo
 
We cant access filers via google app script. star below issue to get updates.
https://code.google.com/p/google-apps-script-issues/issues/detail?id=524
Add a comment...