Search code examples
sharepointsharepoint-2013

Determine Field ID for Column in SharePoint 2013 List


I am trying to use SPServices UpdateList operation, and I need the Field ID for my column that I want to change from the default read only setting. How do you determine the Field tag settings?

//Make the author field editable
var author = "<Fields><Method ID='1'><Field /*What stuff goes here?*/ ReadOnly='FALSE' /></Method></Fields>";
$().SPServices({
    operation: "UpdateList",
    listName: "Requests",
    listProperties:"",
    updateFields: author,
    newFields: "",
    deleteFields: "",
    listVersion: "",
    async: false,
    completefunc: function (xData, Status){  
    }
});

Solution

  • I found what to put in the field tag by doing this:

    1. Get the GUID of the list
    2. Navigate to this custom URL: http://[yoursharepointsite]/_vti_bin/owssvr.dll?Cmd=ExportList&List=[yourGUID]
    3. Do a control-F search for your column name, and you have the field tag with all the default parameters!

    So for the above question, the tag is:

    <Field ID="{1lc5j379-ec7e-42a8-901d-j85a3881c0b8}" ColName="tp_Author" RowOrdinal="0" ReadOnly="FALSE" Type="User" List="UserInfo" Name="Author" DisplayName="Created By" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Author" FromBaseType="TRUE" Version="7" />