I have created a Google Sheet add-on that includes a bunch of Google Apps Scripts plus a bunch of formatting over a number of sheets (tabs). When I publish this to the G Suite Marketplace, will that formatting of the sheets (tabs) be included? For example, I have entered column headers, styled the text (colour, font etc). The formatting and text instructs the user where to enter the needed data that allows the add-on to function.
I have searched through the documentation and other Stackoverflow questions, but have not found a response.
The published Google Sheets add-ons doesn't include a copy of the spreadsheet. To include them you could make that your add-on creates a copy of the spreadsheet that includes the formatted sheets or you could publish that spreadsheet as a template.
Reference
Create a file from template
Look at the Create a template with an add-on section
I have found an answer. #Rubén was likely referring to this solution.
To accomplish this, follow these steps.
Create your spreadsheet with associated formatting, text, colours etc.
Go into Share settings and share the spreadsheet with the option Anyone who has the link can view
Then grab the ID of the spreadsheet within the URL (ex. https://docs.google.com/spreadsheets/d/ID_IS_HERE/edit#gid=0)
To copy that spreadsheet use the following code in your add-on.
function importSheet() {
var ss = SpreadsheetApp.openById("sheet ID goes here");
var sheetToCopy = ss.getSheets()[0]; //gets the first sheet
var destination = SpreadsheetApp.getActiveSpreadsheet();
sheetToCopy.copyTo(destination);
}
If your source spreadsheet has multiple sheets, you can get the number of sheets using var number = ss.getSheets().length; then loop through the above code using number to copy each individual sheet.
Regarding the source spreadsheet, Google provides the following detail
// Note that the spreadsheet is NOT physically opened on the client side.
// It is opened on the server only (for modification by the script).
I hope this helps someone else.
Related
What I knew
is how to link data by
="SheetName!A2:B2" (same file, Differet Sheets)
or
=importrange("Url","sheetName!A2)(Different file)
all these require manual edditing
My Question:
If i have a list of these sheet name, or even it's Url,
How can i get dates from other sheets by using these SheetName or Url?
BTW:
i am trying to build a Table Menu for my Inovice system automatically
i had a file with 100+ sheet, every sheet has the same form, and i had looked up how to generate Sheetname list with url, but when i try to link (Using SheetNAme or Url as clue) to get the total sell amount/ client name / time, i counld't.
SAMPLE
https://docs.google.com/spreadsheets/d/1R67knSxkHD8v6ICIYJtb24pMwV_76HoKLDb-S79lzP4/edit#gid=0
thanks for reading and helping, my english expressing may not be precise ,sorry for that.
In G8, try
=indirect(C8&"!C6")
be sure that the layout of each tab is similar (not the case in your spreadsheet) to expand the formula
I want to insert an embedded Google Sheets table into a Google Doc via the Google Doc API. I had hoped that I could do this via an EmbeddedObject. The definition of EmbeddedObject includes a field for LinkedContentReference, but despite the generic name, a LinkedContentReference object seems to refer only to a Sheets chart.
Is there a way to embed a Sheets table in a Google Doc via API?
I did notice that Google Sheets offers a Table Chart as a chart type. This may be an effective workaround.
You need to insert the sheet table as an inline image
An InlineObject contains an EmbeddedObject such as an image.
Now, when you publish a Google Sheets, you have the option to publish it as pdf, but not image. This mean that you would need to perform an additional step of converting the pdf into a supported image format.
Alternatively you can obtain (and save on your Drive) the Sheet as a thumbNail by performing a Files: get request on the Sheet and setting fields to thumbnailLink. Mind that the thumbNail contians the whole sheet view - not only the data range.
Important:
When performing a documents.batchUpdate request InsertInlineImageRequest, you need to specify the uri in the format
https://docs.google.com/uc?export=view&id=PASTE_HERE_YOUR_ID
I would like to use the text from a cell in a formula in Google Sheets.
I have a document with multiple sheets that a variety of people can edit with a H,M,L (high, medium, low) value from a drop-down list. Each person has their own tab in the Google Sheet.
I then have a dashboard that populates based on their choices of H,M,L. I know that I can use the formula =('Jay Delacruz'!C6) for example to populate a cell in another sheet by manually selecting the cells on the other sheet.
However, I am looking to make quite a few of these documents automatically with another Google Script that I am running that creates the individual sheets from a roster of names on the first tab.
My question is, is it possible to have a =('Jay Delacruz'!C6) type formula that instead of the sheet reference it can pull the name of the person from the roster, as this will match exactly the sheets that are automatically generated by the script I have running.
So I would essentially have a pre-populated dashboard of formulae that would become valid once the sheets are created with the names, as created by the other script.
If it makes it a little clearer, there is a link below to make a copy of the Sheet I am working with. All names were randomly generated, so don't reference any real people or data.
https://docs.google.com/spreadsheets/d/1NiXqko8SibD6VsfrnFcj7e7c99Hg-RoSlHVAYWb0E94/copy
Thank you in advance!
Liam
Try
=INDIRECT(C1&"!C6")
Also see here for more info on INDIRECT() function.
I have a main sheet in witch I copy it and create different versions, kind of like simulating different results.
But every time I want to change something in the main sheet, I have to go in all the other sheets I created and changed.
I don't know if it is possible, but the best way for me would be to create a formula like this:
copyFormula(Sheet1!V2) -> And bringed the exactly same result as if I had gone to Sheet1 copied V2 and pasted it this cell.
I tried to create this formula but failed consistently.
Thanks!!
What you need to do is to manipulate the properties of the sheets.
Here is a reference where you can create those actions.
The Sheets API allows you to create sheets, delete sheets, and control
their properties. The examples on this page illustrate how some common
sheet operations can be achieved with the API.
In these examples, the placeholders spreadsheetId and sheetId are
used to indicate where you would provide those IDs. The spreadsheet
ID can be discovered from the spreadsheet URL; the sheet ID can be
obtained from the spreadsheet.get method.
You can refer to this documentation on how you can read the formula you are needing in the entire sheets.
The Sheets API allows you to read values from cells, ranges, sets of
ranges and entire sheets. The examples on this page illustrate how
some common read operations can be achieved with the
spreadsheets.values collection of this API. You can also read
cell values using the spreadsheets.get method, but in most cases
using spreadsheets.values.get or
spreadsheets.values.batchGet is easier to use.
I create many dashboards on Google Spreadsheet, which are basically a spreadsheet containing a bunch of sheets with all sort of different data. Some of these spreadsheets can have up to 30 sheets or more.
I want a way to list the name of all sheets in a spreadsheet on a column using native functions.
I know this could be easily done with a custom function. However this would bring some complications regarding the workflow in my company.
Is there a way to accomplish that without using custom functions?
Thank You very much!
This works in Excel, so if you are able to export your workbook and save it as an Excel file rather than Google Doc this will work.
Go to your "Name Manager"
Create a 'New' name and call it "Sheets"
Insert this formula into the 'Refers to' box =TRANSPOSE(GET.WORKBOOK(1))&T(NOW())
Now insert this formula where you want the list of Sheet names =IFERROR(INDEX(MID(Sheets,FIND("]",Sheets)+1,255),ROW(A1),1),"")
Drag the formula down so A1 progresses (A1 represents the sheet number that you are getting the name of).
Source of solution