Radio Button to Date Property Mapping
This snippet demonstrates how to map a radio button field to a Date property in Notion.
Instructions
- Modify the filter name to scope as needed.
- see filter reference for full list of variants: https://gravitywiz.com/documentation/gcn_notion_page_data/)
- Get the Date property ID from the Notion database and update the $property_id variable.
* Enable the gcn_show_feed_database_debug_info hook: https://gravitywiz.com/documentation/gcn_show_feed_database_debug_info/ * Open the browser developer console and navigate to a GC Notion feed which is connected to the database you are populating into. * Scroll up in the developer console until you see the debug info displayed. * Find the date property and copy the ID.
- Double check that the date format in the radio field options matches the $date_format variable.
* Note: if it doesn't, you can either adjust the date format in the radio field options or adjust the $date_format variable.
Installation:
References:
- GC Notion: https://gravitywiz.com/documentation/gravity-connect-notion/
- Notion page POST reference: https://developers.notion.com/reference/post-page
- Notion Database property reference: https://developers.notion.com/reference/page-property-values#date
Code
Filename: gcn-radio-button-to-date-property-mapping.php