google-sheets-api

Google Spreadsheet API setDataValidation with Regex

[亡魂溺海] 提交于 2021-01-29 09:59:51
问题 Im trying to generate an Google Spreadsheet Template with some Validation with their API, using the Node.Js Package from Google. This is my current Request: { "setDataValidation": { "range": { "sheetId": 1656514345, "startRowIndex": 0, "endRowIndex": 0, "startColumnIndex": 1, "endColumnIndex": 1000 }, "rule": { "condition": { "type": "CUSTOM_FORMULA", "values": [ { "userEnteredValue": "=REGEXMATCH(TO_TEXT(A2:A1000); '([1-9]){4}[-]([1-9]){2}[-]([1-9]){2}$')" } ] }, "inputMessage": "TEST

Using the google sheets api after completing quickstart tutorial

狂风中的少年 提交于 2021-01-29 08:25:12
问题 I'm pretty new to Android app development so please forgive my naivety. I'm currently trying to develop an app that can pull data from a google spreadsheet and write data to it. I've completed the quickstart tutorial so my code is the same as that right now. It all works correctly. My issue is I need to be able to read from my own spreadsheet and I don't really understand the code used so I'm struggling to know where to start. I've looked at this to try and implement the authorisation in

Attach multiple files - Google Sheets/Gmail/Drive

▼魔方 西西 提交于 2021-01-29 08:19:27
问题 I currently have a script to create draft emails and also attach a file to them. Currently, the script does not work for multiple file attachments and also does not work if there are no attachments. Any tips on how to get (1) and (2) [below] Updated for more info: Main objective is to add a multiple file names in Col[3] and attaching the files to the draft using the files names provided in Col[3]. Example: if I type the following into Col[3]: "test.pdf, test2.pdf" it will attach the files

Can you customize / change the spreadsheet ID of a Google Sheet?

自闭症网瘾萝莉.ら 提交于 2021-01-29 05:25:37
问题 Can you customize / change the spreadsheet ID of a Google Sheet (ie. the ID string that shows up in the gsheet's URL)? I ask this because when looking at the docs for the gsheet api's create() method and looking at the expected request body template, I see that one of the fields available is the spreadsheetId . Does this mean that I can create() a spreadsheet with a specific spreadsheetId ? I find the docs for the API request bodies to be unclear about what certain fields are and when they

Google Sheets: Import folder range into Master Sheet

老子叫甜甜 提交于 2021-01-29 03:50:51
问题 I'm looking to import rows from spreadsheets in a source folder that will be updated daily with new spreadsheets. Is it possible to pull a specific range from every new spreadsheet in the source folder into a Master Sheet? I've been using the following code from an answer to a similar question here. This works perfectly except it duplicates the data that has already been imported to the Master Sheet. How can I fix this? function getdata() { //declare multiple variables in one statement -

Is it possible to further reduce the cost of the request with Google sheets api v4 in setValue and setNumberFormat?

这一生的挚爱 提交于 2021-01-28 21:28:44
问题 Now I use the code below to format and insert values. function AddName () { const range1 = ['Q4:Q','S4:S','U4:U','W4:W','Y4:Y','AA4:AA','AC4:AC','AE4:AE', 'AG4:AG','AI4:AI','AK4:AK','AM4:AM','AO4:AO','AQ4:AQ','AS4:AS','AU4:AU','AW4:AW','AY4:AY','BA4:BA', 'BC4:BC','BE4:BE','BG4:BG','BI4:BI','BK4:BK','BM4:BM','BO4:BO','BQ4:BQ','BS4:BS','BU4:BU','BW4:BW', 'BY4:BY','CA4:CA','CC4:CC','CE4:CE','CG4:CG','CI4:CI','CK4:CK','CM4:CM','CO4:CO','CQ4:CQ','CS4:CS', 'CU4:CU','CW4:CW','CY4:CY','DA4:DA','DC4

How to create a sheet under a specific folder with google API for python?

瘦欲@ 提交于 2021-01-28 20:31:46
问题 I am able to create a sheet with the code below in the root of ‘My Drive’ but how do I create the sheet under a folder in “My Drive” or “Shared drives”? from googleapiclient.discovery import build service = build(‘sheets’, ‘v4’, credentials=creds) sheet = service.spreadsheets() body = {} results = sheet.create(body=body).execute() pprint(results) 回答1: You want to create new Spreadsheet in the specific folder. You want to achieve this using google-api-python-client with python. If my

Are Google Spreadsheets' first sheets always given an ID of 0?

馋奶兔 提交于 2021-01-28 18:17:35
问题 I'm using the Google Spreadsheets API and I'm curious as to whether or not the default first sheet, at the time of creating any new sheet, always has an ID of 0. I tried to research about this, but could not find any documentation regarding this. Should I assume it will always be 0, or should I get it every time just to be on the safe side, in case they change it? 回答1: How about this answer? Situation 1: When new Spreadsheet is created without the parameter for sheetId , the sheet, which is

Update Google Sheet “Filter View” w/ New Range

早过忘川 提交于 2021-01-28 16:51:36
问题 I have a spreadsheet with various filter views set in place. Normally this works great but occasionally new rows are added and I have to manually update the range in each filter view. I've tried searching for solutions online and came up with the following code that might update the range: function UpdateFilterView() { var dataSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Data'); //for each (var dataSheet in sheets){ var lastRow = dataSheet.getLastRow(); var lastColumn =

Update Google Sheet “Filter View” w/ New Range

狂风中的少年 提交于 2021-01-28 16:50:10
问题 I have a spreadsheet with various filter views set in place. Normally this works great but occasionally new rows are added and I have to manually update the range in each filter view. I've tried searching for solutions online and came up with the following code that might update the range: function UpdateFilterView() { var dataSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Data'); //for each (var dataSheet in sheets){ var lastRow = dataSheet.getLastRow(); var lastColumn =