Skip to content

Commit

Permalink
added a generic request.
Browse files Browse the repository at this point in the history
  • Loading branch information
muddi900 committed Mar 15, 2024
1 parent 9a6496c commit 3260f83
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions gspread/worksheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -3201,10 +3201,21 @@ def cut_range(
return self.client.batch_update(self.spreadsheet_id, body)

def add_validation(
self, range: str, validation_type: Any, values: list[list[Any]]
self, range: str, validation_type: Any, *values,
) -> Any:
grid = a1_range_to_grid_range(range, self.id)

body = {
"requests": [{}],
"requests": [{
'setDataValidation': {
'range': grid,
'rule': {
'condition': {
'type': validation_type,
'values': [{'userEnteredValue': value} for value in values]
}

}
}
}],
}

0 comments on commit 3260f83

Please sign in to comment.