Question Details

No question body available.

Tags

python google-sheets-api

Answers (1)

Accepted Answer Available
Accepted Answer
March 11, 2026 Score: 2 Rep: 11 Quality: High Completeness: 100%

This comes from how the Sheets API field mask works: textRotation is returned as either angle or vertical depending on what you request. If you don’t ask for angle, you only get vertical.

From Google’s issue tracker, the intended behavior is:

  • You must explicitly request angle in the fields parameter to get the rotation angle.

  • The type is effectively “angle or vertical”, so the response shape depends on what you put in the field mask.

Fix: request textRotation(angle) in your fields

Include angle inside textRotation in your fields string. For example, for effectiveFormat:

fields = """sheets(properties(sheetId,title),merges,bandedRanges,data(rowData(values(userEnteredValue,effectiveValue,formattedValue,userEnteredFormat(backgroundColor,horizontalAlignment,verticalAlignment,textRotation(angle),textFormat,borders),effectiveFormat(backgroundColor,textRotation(angle),textRotation(vertical),textRotation,textRotation(angle),textFormat,borders)))))"""

You can’t list textRotation twice, so the minimal change is to add angle where you already have textRotation.

So in your existing fields string, change:

  • effectiveFormat(..., textRotation, ...)
    to

  • effectiveFormat(..., textRotation(angle), textRotation(vertical), ...)
    (and the same for userEnteredFormat if you need rotation there).

Concrete change in your code

Replace the fields in your get call with something that explicitly includes angle (and optionally vertical) under both format objects, e.g.:

fields = (
    "sheets("
    "properties(sheetId,title),"
    "merges,bandedRanges,"
    "data(rowData(values("
    "userEnteredValue,effectiveValue,formattedValue,"
    "userEnteredFormat(backgroundColor,horizontalAlignment,verticalAlignment,textRotation(angle),textRotation(vertical),textFormat,borders),"
    "effectiveFormat(backgroundColor,horizontalAlignment,verticalAlignment,textRotation(angle),textRotation(vertical),textFormat,borders)"
    ")))"
)

After this, cells with angled text should return e.g. "textRotation": { "angle": 45 } instead of only "vertical": false. If you need both angle and vertical in one response, request both textRotation(angle) and textRotation(vertical) as above; the API will populate the one that applies (angle for rotated, vertical for stacked).