Skip to content

Get‐DataverseAttributes

Reza edited this page Jan 4, 2024 · 2 revisions

Get-DataverseAttributes is a function that returns all attribute metadata of a given entity. The attributes can be filtered by type. If attributes are not filtered by type only the common properties will be retrieved from Dataverse. Filtering attributes by type will cause the function to include more metadata that is specific to a given type.

This command requires you to authenticate first using Connect-Dataverse command.

Syntax

Get-DataverseAttributes [-EntityLogicalName] <String[]> [[-AttributeType] <String>] [[-Select] <String>]
[[-Filter] <String>] [[-Expand] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]

Parameters

-EntityLogicalName <String[]>

The logical name of the entity in Dataverse.

-AttributeType

The type of attributes to retrieve from Dataverse. By default, no filtering is applied. Filtering attributes by type will cause the function to include more metadata that are specific to the given type.

-Select

The name of properties to include for attributes.

-Filter

Filter the list of attributes based on a criteria. You can use the same syntax as Web API (OData) to filter the attributes.

-Expand

Expand a property or a list of properties to include more data. You can use the same syntax as Web API (OData) to filter the attributes.

-WhatIf []

-Confirm []

CommonParameters

This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).

Examples

Example 1:

The following example retrieves all metadata attributes for the account and contact tables.

PS > Get-DataverseAttributes -EntityLogicalName 'account', 'contact'

Example 2:

The following example uses piping to retrieves all metadata attributes for the account and contact tables.

PS > 'account', 'contact' | Get-DataverseAttributes

Example 3:

The following example retrieves all metadata attributes that are of type Decimal for the account table. Specifying the type will make the command download additional properties that are specific to decimal attributes.

PS > Get-DataverseAttributes -EntityLogicalName 'account' -AttributeType Decimal

Example 4:

The following example retrieves all metadata attributes that are of type PickList for the account table. Specifying the type will make the command download additional properties that are specific to decimal attributes. -Expand OptionSet will expand the OptionSet property which contains all the possible values for PickList attributes. -Filter "IsValidForRead eq true" will limit the result to attributes that are writable. If you are downloading the metadata for code generation this filter can be useful.

PS > Get-DataverseAttributes -EntityLogicalName 'account' -AttributeType Picklist -Expand OptionSet -Filter "IsValidForRead eq true"