Thursday, January 29, 2015

Remove the grayed out columns created by InfoPath that are not mapped to SharePoint columns

Sometimes when you map InfoPath columns to SharePoint columns, if you switch environments and the column IDs don't match up you'll get grayed out columns in addition to your SharePoint columns:


You can go back into InfoPath and under Form Options -> Property Promotion, go through and map each column to the proper SharePoint content type and column that you created, and re-publish the InfoPath form.  Then run the following:

$web = Get-SPWeb -identity http://webapp/site
$list = $web.Lists["LISTNAME"]
foreach($column in $list.Fields)
{
if ($column.Group -eq "Microsoft Office InfoPath")
{
if ($column.ReadOnlyField -eq $true)
{
Write-Host $column.Title
$column.Hidden = $false
$column.ReadOnlyField = $false
$column.Update()
$list.Fields.Delete($column)
}
}
}

and you'll remove the extra columns and your InfoPath data should be mapped to your SharePoint columns properly.



1 comment:

Anonymous said...

Therefore, deciding which on-line slot machine to play usually requires guesswork unless you play free of charge first. Ducky Luck is our top choose for jackpot games, due to an awesome selection of over 20 games that provide the chance to win large sums of cash. You can get a really feel for them free of charge earlier than diving in with real cash on the games you assume provide one of the best chance of profitable. Ignition has a closely curated selection of over 150 slot games. These are all supplied by some of the 점보카지노 the} biggest names within the iGaming world — permitting you to test some of the the} world’s best real cash games completely free of charge.