[PYTHON API] Adding an new row with date column
Using the python SDK, I'm having trouble adding a new row to a sheet where one of the columns is a DATE column. For ex, doing:
cell.value = datetime.datetime.now()
with the column type as DATE doesn't assign anything to the column, and the request comes back with an error since the cell.value is empty.
If online I switch the column type to TEXT NUMBER and do:
cell.value = str(datetime.datetime.now())
then it completes successfully. I'm not sure what I'm doing wrong. Looking into the source of the python sdk seems to indicate that a datetime.datetime object is what should be passed, but when stepping through the code, it does some type checking and skips it setter since it's not realizing at the time that the cell is from a DATE column. Any help would be appreciated.
Comments
-
Have you tried adding the row with the value attribute on the cell object set to a string of the date in the ISO-8601 format the API is expecting? This would be used if sending the request directly via a REST client or something like cURL. For example, if sending today's date of Oct 13th, 2019 you would put I "2019-10-13" as the value.
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.8K Get Help
- 437 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 65 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives