Add NotionDatabaseProperty - fasteiner/Notion GitHub Wiki
Category: Commands external help file: Notion-help.xml Module Name: Notion online version: https://developers.notion.com/reference/update-property-schema-object schema: 2.0.0 Type: Command
Adds a new property to a Notion database.
Add-NotionDatabaseProperty [-DatabaseId] <String> -property <Object> -PropertyName <String>
[-ProgressAction <ActionPreference>] [<CommonParameters>]
The `Add-NotionDatabaseProperty` function adds a specified property to a Notion database using the Notion API. You can specify the database ID, the property object, and the name of the property to be added. The function supports pipeline input for adding multiple properties in a single invocation.
Add-NotionDatabaseProperty -DatabaseId "12345abcde" -property @{ type = "title"; title = @{ text = @{ content = "New Title" } } } -PropertyName "Title"
Adds a new title property named "Title" to the database with the ID `12345abcde`.
@(
@{ property = @{ type = "number"; number = @{ format = "number" } }; PropertyName = "Score" },
@{ property = @{ type = "select"; select = @{ options = @(@{ name = "Option 1" }, @{ name = "Option 2" }) } }; PropertyName = "Category" }
) | Add-NotionDatabaseProperty -DatabaseId "12345abcde"
Adds multiple properties (`Score` and `Category`) to the database with the ID `12345abcde` using pipeline input.
$input = @{
DatabaseId = "12345abcde"
property = @{ type = "number"; number = @{ format = "number" } }
PropertyName = "Score"
}
Add-NotionDatabaseProperty @input
Adds a new number property named "Score" to the database with the ID `12345abcde`.
The unique identifier of the Notion database where the property will be added. This parameter is mandatory.
Type: String
Parameter Sets: (All)
Aliases: Id
Required: True
Position: 1
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
The property object to be added to the database. This parameter is mandatory and accepts input via the pipeline by property name.
Type: Object
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
The name of the property to be added to the database. This parameter is mandatory and accepts input via the pipeline by property name.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
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.
https://developers.notion.com/reference/update-property-schema-object