Show this Google Sheets API feature request some love with a comment or +1!:

## Inclusion of a 'setToFit' boolean in row metadata. `pixelSize` does not accurately read row assigned 'Fit to data'

### Description

#### Issue
There is currently no way to get or set the row height to `Fit to data` in the same way that you can in Google Sheets by right-clicking the row, `Resize row` > `Fit to data`.

The closest approximation is in `rowMetadata` > `pixelSize`. However, pixel size is inaccurately read when the row is set to `Fit to data`, reading only the default 21 pixels even when the data may expand the height of the row beyond this pixel height.

See this bug report for an example: [There is no way to get the real height of a row if its height is based on the height of the content in its cells.](issuetracker.google.com/issues). _*The Googler assigned to this bug recommended that a feature request should be made. This is the feature request._

#### Proposed Solution
Introduce the property: `setToFit` as a boolean into `rowMetadata` array of objects alongside `pixelSize`.

Just like when assigning `Fit to data` in Google Sheets, `setToFit` would take priority over `pixelSize` setting any row that has `setToFit` marked as `true` to a row height that would fit the data.

This is a low-memory solution for the API (boolean property) and does not require any modification of existing properties allowing it to be added to the existing API v4.

### Impact
Currently, devs must manually ensure that each row of data is not set to `Fit to data` before modifying duplicating or cutting and pasting ranges with the correct row height. Otherwise, the row heights will not be accurately represented.

With the inclusion of `setToFit` developers would be able to accurately determine if selected rows are based on the actual pixel height or `Fit to data`.

#### Getting and setting the row heights
Let's say a developer wants to copy a range of data from one Google Sheet or Sheet tab to another and ensure that they also duplicate the correct row height.

When iterating over their `rowMetadata` they would first check if `setToFit` is `true` If so, they would mark the property to true in their batch upload payload, otherwise, they would set the `pixelSize`.

issuetracker.google.com/issues

Copy and Paste Row Heights in Google Sheets with Apps Script. This is a surprisingly tricky and process-costly task. Learn how to do it efficiently while not falling for some common issues. @workspacedevs

youtu.be/HAx1LfcxdRA

Copying Ranges in Google Sheets with Apps Script - Part 4 in the beginner-friendly series on copying Sheets, Tabs and Ranges in with . Check it out!
@workspacedevs

youtu.be/q6Zh3I9mjeg

CASA Tier 2 Assessment finally passed for the update of my free 'Sections to Sheets' Google Workspace Editor Add-on.
It was an unusual process. Not necessarily time-consuming, but it did take weeks to process so be prepared for that, developer. @WorkspaceDev

Duplicate Google Sheets Tabs into other Spreadsheets with Apps Script.

Copy to:

1) a new Google Sheet,

2) an existing Google Sheet,

3) All tabs,

4) Selected tabs and

5) Except for certain tabs.

Beginner friendly. 🧸

@workspacedevs

youtu.be/te9bXK4DngE

Learn how to copy sheet tabs within the same Google Sheet with Google Apps Script.
This is a beginner-friendly series on duplicating Google Sheets, Sheet tabs and ranges with Apps Script.
@workspacedevs
youtu.be/xDwWA57kArI

Make a Copy of a Google Sheet with Apps Script.
Part of a series on duplicating Google Sheets, Sheet tabs and ranges with Apps Script.
If you are new to Apps Script this is ideal for you.
@workspacedevs

youtu.be/34ozx-6sv34

CASA Tier 2 compliance for Google Workspace Add-ons is a PIA, but one good thing that came out of it was updating old code from JQuery to JavaScirpt. Dependencies are not recommended and honestly were never needed for this project.

I've made a few updates in recent days to my Google Workspace Add-on Course. The biggest addition is that you can get answers to some common error codes in Card Service with the Common Errors Page.

@workspacedevs

yagisanatode.com/products/crea

Add the Editor's Email when they Tick the Check Box in Google Sheets with Apps Script - This tutorial came from a discussion with an attendee at the Google Workspace Developer Summit 2023 in Singapore last week.

If you and your team are working in a Google Workspace Domain account (Paid Version) this handy onEdit() automation might shave some admin time off your work for you. Enjoy!

Contains a written and a video tutorial with a starter Google Sheet to play along.

@workspaceDevs

yagisanatode.com/add-the-edito

Creating Webhooks for Google Chat App with Apps Script. Learn how to conduct a pirate raid in . Message, Reply & Create visual Cards @workspacedevs
yagisanatode.com/chat-app-webh

I've torn myself away from Baldur's Gate 3 long enough to create this D&D-inspired tutorial on creating a Reduced Choice Dropdown Data Validation in Google Sheets with Apps Script. Enjoy!
@workspacedevs
youtube.com/watch?v=XFEvYlpK7n

Sometimes we want to compare the difference between two arrays in JavaScript and return the remaining values in a new array.
This can be useful for inventory or purchase management where we could compare the selected items against the available stock. wp.me/p9ksIb-7fQ

How does MAKEARRAY work in ? Let's build and shuffle a deck of cards and find out. 🃏♥♦♠♣

youtu.be/x9cJwx0E1vY

Need to convert a column of data to a 2d range or convert a 2d range to a column? In this tutorial, we cover how to stack and unstack data in Google Sheets

youtu.be/t2TBTQhQEuE

REVERSE_ROWS and REVERSE_COLS have now been added to the Named Function Pack. You can find out more here: yagisanatode.com/products/name

Show older
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.