[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.5K Get Help
- 430 Global Discussions
- 136 Industry Talk
- 465 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 146 Just for fun
- 63 Community Job Board
- 466 Show & Tell
- 32 Member Spotlight
- 2 SmartStories
- 301 Events
- 39 Webinars
- 7.3K Forum Archives