I'm launching the cutPaste
method of the google sheets api documented here:
https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/request#cutpasterequest
in the manner described here: https://developers.google.com/sheets/api/samples/data#cut_and_paste_cells
using the pygsheets python library.
I tried with both PASTE_NORMAL and PASTE_VALUES but and nothing happens. No error returned, no action taken whatsoever.
Same thing with copyPaste()
.
All other batchUpdate
functions I used, like addSheet()
(as well as non-batchUpdate functions), work flawlessly.
Any clues?
def copy_paste(sheet, orig_start, orig_end, dest_start, dest_end):
sheet.client.sh_batch_update(sheet.spreadsheet.id, {
'copyPaste': {
'source': pygsheets.DataRange(start=orig_start, end=orig_end,
worksheet=sheet)
._get_gridrange(),
'destination': pygsheets.DataRange(start=orig_start, end=orig_end,
worksheet=sheet)
._get_gridrange(),
'pasteType': 'PASTE_VALUES',
'pasteOrientation': 'NORMAL',
}
})
copy_paste(sheet, 'A1', 'A2', 'B1', 'B2')
Update I've shared the worksheet https://docs.google.com/spreadsheets/d/1UCH0eW1UEksn1HjKxba50PVKvIivkWZnjX2Nd-aIE0c/edit?usp=sharing
Here's the request
And here's the response