Managing Content Types To Change Linked Columns In Sharepoint

Understanding Content Types and Site Columns

Content types are reusable collections of settings that define the metadata, workflow behavior, and key columns for items in SharePoint lists and document libraries. Site columns are the individual data fields within a content type that capture attributes and metadata for items.

Content types allow centralized management of columns at the site level. Columns can be defined once in the site collection and then linked to multiple content types. This promotes consistency and enables propagation of changes across dependent artifacts.

Definition of Content Types and Site Columns

A SharePoint content type encapsulates common settings and columns for structuring data consistently across list items and library files. Each content type acts as a blueprint for applying managed metadata and configurations.

Site columns are customizable fields defined at the site level that enable capture of metadata. They prescribe input formats and data types for items. Site columns can be linked to multiple content types and propagated across all associated lists and libraries.

Overview of Linking Site Columns to Content Types

Site columns must be associated with content types before they can be applied to SharePoint lists or document libraries. The content type provides the bridge between site columns and lists/libraries by bundling relevant columns and propagating them to target locations.

Linking a site column to a content type clones the field settings and data validation rules. Changes to the source site column are cascaded to all locations using that content type. This enables centralized updates.

Identifying the Content Type and Columns to Change

Using Site Settings to View Current Content Types and Columns

The Site Settings page displays all content types defined for the site collection. It also lists all site columns available for inclusion in content types. This enables review of existing content types and columns.

Navigate to Site Settings > Site Columns and Site Content Types to audit existing definitions. The interface allows sorting and filtering to hunt for a specific column or content type.

Determining Which Content Type Requires Changes

If the goal is to update columns for a particular set of lists or libraries, identify the associated content type powering those locations. Check the settings for the target list or library to see the assigned content type.

Cross-reference any other lists/libraries classifications to confirm if a change to one content type would affect additional locations. Consider creating a new content type if updates need to be restricted.

Identifying the Linked Columns That Need to Be Updated

Review the column definitions bundled in the content type. Document the site columns that need modifications to support evolving requirements. Consider if additional site columns must be added to the content type during the update.

Also, note site column customizations like required settings, defaults values, and input formats that may need adjustments for the altered business needs.

Breaking the Link Between Columns and Content Types

Using PowerShell to Remove Column Links

The PowerShell Remove-SPUserSolution allow removing associations between site columns and content types. This takes the columns definitions out of content types but does not delete columns.

This example breaks links for the �Location� and �Regulated Data� columns in the �Document Set� content type:

$web = Get-SPWeb https://my.sharepoint.com
$ct = $web.AvailableContentTypes[�Document Set�]
$sc1 = $web.Fields[�Location�]
$sc2 = $web.Fields[�Regulated Data�]
$ct.FieldLinks.Delete($sc1)
$ct.FieldLinks.Delete($sc2)
$ct.Update()

Example PowerShell Code to Break Links

This PowerShell script iterates through all columns linked to a content type and removes associations. Customize web and content type names.

 
$site = Get-SPSite https://contoso.sharepoint.com 
$web = $site.OpenWeb()
 
$ct = $web.ContentTypes[�Contracts�]
 
foreach ($fieldLink in $ct.FieldLinks) 
{
     $ct.FieldLinks.Delete($fieldLink.Name)
}
 
$ct.Update($true)
$web.Dispose()
$site.Dispose()

Adding Updated Columns to the Content Type

Re-adding Updated Columns to the Content Type

After breaking column links, modified site column definitions must be reconnected. This clones the new settings into the content type for propagation across dependent libraries and lists.

Use the PowerShell Add-SPUserSolution command to re-establish links. Provide the site column and content type objects as parameters.

Verifying New Column Settings

Double check the content type to validate updated column configurations were copied over successfully. Test by creating new library items or documents using the altered content type.

Verify data imports as expected with the revised site column requirements and formatting. Make additional content type adjustments if issues surface.

Example PowerShell Code to Link Columns

This example reconnects two site columns with new settings to the �Document Set� content type after updates:

$web = Get-SPWeb https://my.sharepoint.com 
$ct = $web.AvailableContentTypes[�Document Set�]  
$sc1 = $web.Fields[�Location�] 
$sc2 = $web.Fields[�Regulated Data�]
$ct.FieldLinks.Add($sc1)
$ct.FieldLinks.Add($sc2)
$ct.Update()

Propagating Column Changes Across Libraries

Pushing Column Changes to Documents Using Content Types

Upon reconnecting updated site columns to content types, the new field schemas and settings automatically propagate to all associated SharePoint lists and libraries.

Existing library documents or list items inherit changes to column names, formats, defaults values, and required settings. New items will be created with the revised column configuration.

Recrawling Site to Update Search Results

After propagating column changes, initiate a manual site crawl using the SharePoint search administration page. This reindexes content to surface items reflecting the updated metadata schema.

Refining the search crawl to target specific lists or libraries will expedite reindexing. Monitor crawl logs to track status for troubleshooting any failures.

Monitoring Changes Across Libraries and Lists

Review random samples of existing documents and list items throughout the site inherit the intended column transformations. Also test creating new library files to validate the revised content type layout.

Check analytics for document profile and metadata usage reports after the changes roll out to confirm adoption.

Troubleshooting Issues with Content Types

Fixing Error Messages About Column Changes

If errors appear during content type updates, check correlation ID values against the Unified Logging Service (ULS) logs. Filter ULS logs on category �SharePoint Foundation� for clues on faulty modifications.

Also review verbose PowerShell scripts outputs. Capture correlation IDs and search logs for these to uncover detailed resolution steps.

Handling Issues Pushing Updates to Libraries

If column changes won�t propagate to dependent libraries, validate the SharePoint Timer service is running on all front-end web servers. This schedules distributions.

Also confirm the site mailbox for alerts has storage space. Lack of capacity can block change notifications and content type updates.

Example Log Files for Diagnosing Problems

Some key log files for troubleshooting include:

  • ULS Logs – %ProgramFiles%\Common Files\Microsoft Shared\Web Server Extensions\Logs
  • SharePoint Timer Service Log – %ProgramFiles%\Common Files\Microsoft Shared\Web Server Extensions\Logs\msts.log
  • Site Mailbox Logs – %ExchangeInstallPath%Logging\MailboxConnectors

Leave a Reply

Your email address will not be published. Required fields are marked *