Duarte Nobrega
 

Script to change List items values for a specific field

22

Jul

When you have an extensive Sharepoint list, and for some reason you need to change the value of the list items, it is handy to have a script for such job. The following script to changes a field value for all items in a SharepPoint list.


To use the script:

  1.  Go to the live Sharepoint server
  2. Place the script TamTam.SharePoint.ChangeContentTypeScript.exe”  in the C:\SharepointScripts folder
  3. Run the script:
    1. TamTam.SharePoint.ChangeContentTypeScript.exe SPListURL LisName FieldName FieldValue
    2. Ex:
      1.  TamTam.SharePoint.ChangeContentTypeScript.exe http://mossdev/news/ Pages  NewsCategory MediaIntranet

If you wish to change the value only when a certain value already exists, for instance if a field named NewsType has the value “MediaIntranet”, should be changed to “Intranet”, do the following:

a. TamTam.SharePoint.ChangeContentTypeScript.exe http://mossdev/news/ Pages  NewsCategory MediaIntranet Intranet
b. TamTam.SharePoint.ChangeContentTypeScript.exe SPListURL LisName FieldName FieldValue NewFieldValue

Below are the executable and the source code for this script:

TamTam.SharePoint.ChangeFieldValue.exe.zip (3.24 KB)TamTam.SharePoint.ChangeFieldValue.source..zip (15.88 KB)

Duarte Nobrega schreef

Comments (0)

Duarte Nobrega
Comments are closed.

Zoeken

Categorie

Archief


Sign In