Skip to content

New NotionDatabase

fasteiner edited this page Feb 22, 2025 · 1 revision

Category: Commands external help file: Notion-help.xml Module Name: Notion online version: https://developers.notion.com/reference/create-a-database schema: 2.0.0 Type: Command

New-NotionDatabase

SYNOPSIS

Creates a new Notion database.

SYNTAX

New-NotionDatabase [[-parent_obj] <Object>] [[-title] <Object[]>] [-properties] <Hashtable>
 [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

The New-NotionDatabase function creates a new Notion database within the specified parent object, title, and properties. It converts the provided parameters to the appropriate types and makes an API call to create the database in Notion.

EXAMPLES

EXAMPLE 1

$parent = @{
    type    = "page_id"
    page_id = "12345678901234567890"
}
$title = "My New Database"
$properties = @{
    Name = @{
        type = "title"
        title = @{}
    }
}
New-NotionDatabase -parent_obj $parent -title $title -properties $properties

This command creates a new Notion database within the specified parent page, title, and properties.

PARAMETERS

-parent_obj

The parent object of the page. If not provided, a default parent will be used.

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
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

The properties objects of the database. This parameter is mandatory.

Type: Hashtable
Parameter Sets: (All)
Aliases:

Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-title

The title (or title object) of the database. Can be a string or an array of rich text objects.

Type: Object[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
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 a notion_database object representing the newly created database.

NOTES

This function requires the Invoke-NotionAPICall and Remove-NullValuesFromObject helper functions, as well as the notion_database, notion_parent, rich_text, rich_text_text, and notion_databaseproperties types.

RELATED LINKS

https://developers.notion.com/reference/create-a-database

Notion Module

Home
Module-FAQ
SetupOfIntegration

Commands
Classes
Enums

Clone this wiki locally