jamalex / notion-py

Unofficial Python API client for Notion.so
MIT License
4.28k stars 476 forks source link

How to get data from multiple columns in a table? #149

Open kvnandula04 opened 4 years ago

kvnandula04 commented 4 years ago

I have a habit tracker and want to get data from 2 of the columns in my table. The image I've attached shows the names of the columns. The specific ones I need to get the data from are Date and Screen Time. Any help would be much appreciated.

image

Thanks in adavance, Karthik

sanjeevbhalla commented 4 years ago

If you have fetched the row then you can just do row.colname so row.Date should work. But because some of your properties have spaces in them you may have to do row.get_property("Screen Time")

If you have not gotten the row as yet then you need to first get access to the table (using the URL) and then run a query to get rows cv = client.get_collection_view() result = cv.default_query().execute()