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-NotionDatabase

SYNOPSIS

Edit the properties, title, and description of an existing Notion database.

SYNTAX

Edit-NotionDatabase [-DatabaseId] <String> [-title <Object[]>] [-properties <Hashtable>]
 [-description <Object[]>] [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

The Edit-NotionDatabase function allows you to edit the properties, title, and description of an existing Notion database.

EXAMPLES

EXAMPLE 1

$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.

EXAMPLE 2

$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.

PARAMETERS

-DatabaseId

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

-description

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

-ProgressAction

{{ 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

-properties

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

-title

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

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

[notion_database]

Returns the updated Notion database object.

NOTES

This function requires the Invoke-NotionAPICall function to make API calls to Notion.

RELATED LINKS

https://developers.notion.com/reference/patch-database

⚠️ **GitHub.com Fallback** ⚠️