Can I Add a Related Page as a Property in a Notion Page I'm Trying to Append?

This topic was automatically generated from Slack. You can find the original thread here.

Is there a step where I can add a related page as a property in a notion page that I am trying to append?

Yes, you can use the “Notion — Update Page” action to update a page’s properties, including adding a related page as a property. Here’s how to use it: 1. Search for the Notion app from the step menu 2. Select the Update Page action 3. Connect your Notion account 4. Select a Page ID or pass a string from a previous step. 5. At the bottom of the step, click Test to run the action and test the configuration. You can configure the optional props to set the related page property. For more details, please refer to the Notion API documentation on how to structure the property update. If you need further assistance, feel free to visit https://pipedream.com/support for more support options.

the property that I am trying to append is a property that is a related link inside notion, so its not showing on the option of page property to update. Is there a python code that I can use to add that related page in the property

I understand that you want to add a related page as a property in a Notion page using Python. To achieve this, you can use the Notion API with Python. Here’s an example using the notion-client library to update a related page property: First, install the notion-client library: bash pip install notion-client Then, use the following Python code to update the related page property: from notion_client import Client notion = Client(auth="your_notion_api_key") page_id = "your_page_id" related_page_id = "related_page_id" # Get the page properties page = notion.pages.retrieve(page_id) properties = page["properties"] # Update the related page property properties["your_property_name"]["relation"].append({"id": related_page_id}) # Update the page with the new properties notion.pages.update(page_id, properties=properties) Replace your_notion_api_key, your_page_id, related_page_id, and your_property_name with the appropriate values. Please note that this is a Python code example and not a Pipedream component. If you need further assistance, feel free to visit https://pipedream.com/support for more support options.