Python API - How do I transfer a date-time value from a Pandas data frame to a new row?
Hi! This is my first question in the forum, so please let me know if I'm doing something wrong.
I have some data in an excel csv file, and I have copied it into a Pandas data frame. One of the fields in the csv has this format: "3/17/2022 10:59:00 AM" and when transferred to the data frame it shows '3/17/2022 10:59'. So I convert it to what I think is the right Smartsheet format with this line, 'Created' being the column name:
data_frame['Created'] = pd.to_datetime(data_frame['Created']).dt.strftime("%Y-%m-%dT%H:00:00Z")
and ends up being '2022-03-17T10:00:00Z'.
When I create the smartsheet row using a loop and
the field shows in smartsheet as '2022-03-17T10:00:00Z'. And if I use a formula like =TODAY() - [Created Date]@row, I get an error #INVALID OPERATION.
How can I get it right?
If I use "%Y-%m-%d" it does not work, I get 2022-03-17 but it still throws an error in the sheet.
If I do something like
it works, but to do that I would need to split the loop and it may overcomplicate things.