nithinmurali / pygsheets

Google Sheets Python API v4
https://pygsheets.readthedocs.io/en/latest
Other
1.5k stars 220 forks source link

Remove formatting of appended row in 'append_table'? #573

Open caynebrister1 opened 1 year ago

caynebrister1 commented 1 year ago

Hey, I love this library, it is so much better than using the normal lib.

One thing I cant seem to solve is formatting being added to every appended row using 'append_table'. For some reason every time I append a row, the appended row inherits the formatting of the previous row. Is there a way to prevent this or to remove the formatting of the newly appended to after?

Thanks ahead of time!

nithinmurali commented 1 year ago

Hi, looks like that's the default behavior of the google sheets api call.

Some options i could think of (untested, might not work)

caynebrister1 commented 1 year ago

Thanks! Getting off from work right now. Ill test it out tomorrow!

caynebrister1 commented 1 year ago

Hi, looks like that's the default behavior of the google sheets api call.

Some options i could think of (untested, might not work)

* try passing `valueInputOption=RAW or USER_ENTERED` to the append_table call

* remove formatting of the row by calling [this](https://pygsheets.readthedocs.io/en/latest/datarange.html#pygsheets.datarange.DataRange.apply_format). You can create a [DataRange](https://pygsheets.readthedocs.io/en/latest/datarange.html#pygsheets.datarange.DataRange) from the returned response["updates"][0]["updatedRange"]

For valueInputOption=RAW or USER_ENTERED did you mean valueInputOption='RAW'? valueInputOption='RAW' doesn't seem to work.