You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When adding validation like one_of_range for a range, for example, A5:A, an absolute reference is placed instead of the specified reference. For example, =Sheet1!$C5:$W5 turns into =Sheet1!$C$5:$W$5
To Reproduce
Steps to reproduce the behavior:
Run the code from the code example block
Expected behavior
I expect to get a non-absolute reference to the range in the values field, as in Screenshot 1. For the screenshot, I did it through the browser.
Code example*
from gspread.auth import authorize
from google.oauth2.service_account import Credentials
from gspread.utils import ValidationConditionType
credentials_path = PATH_TO_CREDS_HERE
sheet_id = SHEET_ID_HERE
scopes = [
"https://www.googleapis.com/auth/spreadsheets",
"https://www.googleapis.com/auth/drive",
]
creds = Credentials.from_service_account_file(credentials_path, scopes=scopes)
client = authorize(creds)
spreadsheet = client.open_by_key(sheet_id )
worksheet = spreadsheet.sheet1
worksheet.add_validation(
range="A5:A",
condition_type=ValidationConditionType.one_of_range,
values=["=Sheet1!$С5:$W5"],
inputMessage="Select a value from the list",
strict=True,
showCustomUi=True
)
Screenshots
should be:
I got:
Environment info:
Operating System: Windows
Python version: 3.12.3
gspread version: 6.1.4
Additional context
Perhaps this is a problem with the API implementation from Google itself, I tried adding it via batch_update and it also didn't work as expected.
The text was updated successfully, but these errors were encountered:
Describe the bug
When adding validation like
one_of_range
for a range, for example,A5:A
, an absolute reference is placed instead of the specified reference. For example,=Sheet1!$C5:$W5
turns into=Sheet1!$C$5:$W$5
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expect to get a non-absolute reference to the range in the values field, as in Screenshot 1. For the screenshot, I did it through the browser.
Code example*
Screenshots
should be:
I got:
Environment info:
Additional context
Perhaps this is a problem with the API implementation from Google itself, I tried adding it via batch_update and it also didn't work as expected.
The text was updated successfully, but these errors were encountered: