As per the title, I need to be able to update the column order by script. I've created and updated fields using Lists.UpdateList web service Method via SPServices, but can't see an option for changing the field order.

is this possible?


PS Just in case there's other options to achieve what I'm after, or I'm overlooking something, what I'm actually trying to achieve overall is the updating of lists and forms via script instead of the UI. So changes are repeatable and reusable and can be developed and tested on development and QA sites and then easily, accurately and reliably be applied to production sites after. This is the only thing i haven't been able to do so far.

  • If the property is not exposed in the webservice then you can't change it with code, so the answer is no Commented Apr 12, 2017 at 14:40
  • Thanks. The web service doesn't seem to be very well documented, so I was hoping I'd missed something, or there was another way to achieve it.
    – BFG
    Commented Apr 13, 2017 at 15:35

1 Answer 1


You can try to write your own web service or http handler and call it using ajax. I'm not able to test code on SP 2007, but it works on 13. C# reorder func:

function void ReorderColumns(SPList myList, StringCollection orderedFields)
    foreach (SPField field in myList.Fields)
        if (!orderedFields.Contains(field.InternalName))

    StringBuilder sb = new StringBuilder();
    XmlTextWriter xmlWriter = new XmlTextWriter(new StringWriter(sb));
    xmlWriter.Formatting = Formatting.Indented;

    for (int i = 0; i < orderedFields.Count; i++)
        xmlWriter.WriteAttributeString("Name", orderedFields[i]);
    string rpcTemplate = @"<?xml version=""1.0"" encoding=""UTF-8""?>  
        <Method ID=""0,REORDERFIELDS"">  
        <SetList Scope=""Request"">{0}</SetList>  
        <SetVar Name=""Cmd"">REORDERFIELDS</SetVar>  
        <SetVar Name=""ReorderedFields"">{1}</SetVar>  
        <SetVar Name=""owshiddenversion"">{2}</SetVar>  
    string rpcCall = string.Format(

Where orderedFields is ordered collection of fields internal names. Try it.

  • Thanks, looks good. I could be wrong, but sadly I don't think I can use/deploy C# code though. Where does it need to go? I don't have any access to the backend servers.
    – BFG
    Commented Apr 13, 2017 at 15:33
  • Can u put some files to layouts folder on WFE servers or admins can do it for you? If you do, try to create ashx file (handler) which doesn't need to be compiled. Example Commented Apr 17, 2017 at 6:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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