Skip to main content
Set-PropertyMapping

Update your property mappings with PowerShell

Updated this week

Command

Set-PropertyMapping

Description

The command to add or update a property mapping in the mapping settings.

Examples

Set custom mappings

# Set a property mapping for multiple source columns to a single destination column
$mappingSettings = Set-PropertyMapping -Source Col1,Col2,Col3 -Destination MultipleColumn

# Display the created property mappings
$mappingSettings

# Example output:
# PropertyMappings : Col1 -> MultipleColumn
# Col2 -> ───────┘
# Col3 -> ───────┘
# ContentTypeMappings :
# UserAndGroupMappings :
# PermissionLevelMappings :
# SiteTemplateMappings :

Set custom mappings on existing mappings from a source list and a destination list

# Connect to the source site and destination sites
$srcSite = Connect-Site -Url "http://myfarm1/sites/mysourcesite"
$dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite"

# Retrieve the source list from the source site
$srcList = Get-List -Name "mysrclist" -Site $srcSite

# Retrieve the destination list from the destination site
$dstList = Get-List -Name "mydstlist" -Site $dstSite

# Retrieve existing property mappings between the source and destination lists
$mappingSettings = Get-PropertyMapping -SourceList $srcList -DestinationList $dstList

# Add a new property mapping for multiple source columns to a single destination column
$mappingSettings = Set-PropertyMapping -MappingSettings $mappingSettings -Source Col1,Col2,Col3 -Destination MultipleColumn

# Display the updated property mappings
$mappingSettings

# Example output:
# PropertyMappings : Author -> Author
# KEY Created -> Created
# Editor -> Editor
# Modified -> Modified
# Col1 -> MultipleColumn
# Col2 -> ───────┘
# Col3 -> ───────┘
# MyCustomField -> MyCustomField
# KEY Title -> Title
# ContentTypeMappings :
# UserAndGroupMappings :
# PermissionLevelMappings :
# SiteTemplateMappings :

Syntax

Set-PropertyMapping-Source <String[]>
-Destination <String>
[-Key <SwitchParameter>] 
[-MappingSettings <MappingSettings>]
Set-PropertyMapping-Ignore <SwitchParameter>
-Destination <String>
[-MappingSettings <MappingSettings>]

Parameters

-Destination <String>

Specifies the destination property.

Required?

True

Default value

None

Accept pipeline input?

False

Accept wildcard characters?

False

Parameter set name

(All)

Aliases

None

-Ignore <SwitchParameter>

Specifies to ignore the property.

Required?

True

Default value

None

Accept pipeline input?

False

Accept wildcard characters?

False

Parameter set name

ExplicitIgnore

Aliases

None

-Key <SwitchParameter>

Specifies if the mapping is a key.

Required?

False

Default value

None

Accept pipeline input?

False

Accept wildcard characters?

False

Parameter set name

Default

Aliases

None

-MappingSettings <MappingSettings>

Specifies the mapping settings.

Required?

False

Default value

None

Accept pipeline input?

True (ByValue, ByPropertyName)

Accept wildcard characters?

False

Parameter set name

(All)

Aliases

None

-Source <String[]>

Specifies the source properties.

Required?

True

Default value

None

Accept pipeline input?

False

Accept wildcard characters?

False

Parameter set name

Default

Aliases

None

Did this answer your question?