Edit NotionDatabase - fasteiner/Notion GitHub Wiki
Category: Commands external help file: Notion-help.xml Module Name: Notion online version: https://developers.notion.com/reference/patch-database schema: 2.0.0 Type: Command
Edit the properties, title, and description of an existing Notion database.
Edit-NotionDatabase [-DatabaseId] <String> [-title <Object[]>] [-properties <Hashtable>]
[-description <Object[]>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
The Edit-NotionDatabase function allows you to edit the properties, title, and description of an existing Notion database.
$title = "New Database Title"
$properties = @{
"Property1" = @{
"name" = "New Property Name"
"type" = "text"
}
"PropertyToRemove" = $null
}
$description = "This is a new description for the database."
Edit-NotionDatabase -DatabaseId "your-database-id" -title $title -properties $properties -description $description
This command overwrites the title and description and edits the properties of the specified Notion database.
$database = Get-NotionDatabase -DatabaseId "your-database-id"
$db_properties = $database.properties
$db_properties.PropertyToRemove = $null
Edit-NotionDatabase -DatabaseId "your-database-id" -properties $db_properties
This command removes the "PropertyToRemove" property from the specified Notion database.
The ID of the Notion database to be edited.
Type: String
Parameter Sets: (All)
Aliases: Id
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
An array of objects / a single object or string representing the description of the database. Each object can be a string or a rich_text object.
Type: Object[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
A hashtable representing the properties of the database. Use null values to remove properties.
Type: Hashtable
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
An array of objects / a single object or string representing the title of the database. Each object can be a string or a rich_text object.
Type: Object[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
This function requires the Invoke-NotionAPICall function to make API calls to Notion.