0

I have a new SharePoint 2010 library that will contain submitted InfoPath forms. After creating the InfoPath form, I set the fields to be available as columns with the Property Promotion option, then added the content type to the library with SharePoint Designer.

Now, I want to remove some of the columns from being available to click on when creating a view - like "Technician" and "Web Comment". I chalk that up to being a n00b.

Unfortunately, the columns are grayed out in Library Settings so I can't remove them. I went back to the InfoPath form and removed the columns using the Property Promotion option, then republished the form, but the columns are still there and grayed out in Library Settings. (first screenshot below)

However, when I click on the associated content type in Library Settings, it displays the correct list of columns (second screenshot below), but the unwanted columns are still available to be clicked on when creating Views.

Is it possible to get rid of these columns without creating a new library?

Thanks,

Sonya

Library Settings Screen

Content Type Screen

0

InfoPath promoted fields are set to readonly, so you need to set it back to false, then delete the field there after. Keep in mind that you need to modify the infopath form that will be published to leave out that promoted field.

Run this in powershell in order to delete the field:

$web = get-spweb http://sharepoint
$list = $web.Lists["List Name"]
$field = $list.Fields["InfoPath Field Name"]
$field.ReadOnlyField = $false
$field.Update()
$list.Fields.Delete($field)
  • Just the property promotion section. That way, it won't be promoted to a sharepoint column. It will stay as an InfoPath field that will only be displayed by opening the form....that is, if you still want to use it. – Mike Nov 12 '14 at 21:03
  • I'm getting a "Cannot index into a null array" at the field name: PS C:\Users\sp_admin> . 'c:\scripts\script1.ps1' Cannot index into a null array. At C:\scripts\script1.ps1:3 char:23 + $field = $list.Fields[ <<<< "Justification"] + CategoryInfo : InvalidOperation: (Justification:String) [], Run timeException + FullyQualifiedErrorId : NullArray ... – sonyab Nov 12 '14 at 22:05
  • Are you sure you got the list name correct in $list = $web.Lists["List Name"] ? Can you type $list and see if you get back the results of the list properties? – Mike Nov 12 '14 at 23:33
  • It turns out that I didn't have the full path to the forms library that this library was in for line 1. Once I changed that, the script works like a charm. Thanks! – sonyab Nov 13 '14 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.