[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
- Smartsheet Customer Resources
- 64.2K Get Help
- 419 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 141 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives