This project has moved. For the latest updates, please go here.

Updating Wiki Lib Article contents.

Feb 27 at 6:25 PM
Edited Mar 2 at 3:39 AM
I am using SPServices (2014.02) to retrieve ("GetListItems") and update ("UpdateListItems") document and list content, but I am having issues updating Wiki Content. I need to read a Wiki of about 200 articles to find specific link references and rewrite these references with a new domain.

I am able to retrieve the Wiki content (CAMLViewFields: "ID", "FileRef", "LinkFilename", "WikiField") without issue, but my attempt to update the wiki Content is not as successful.

after processing the content for the GetListItems call, I am using the following code to update the Wiki Content of each Wiki article that needs to be rewritten:
    operation: "UpdateListItems", 
    async: false, 
    webURL: "",
    listName: "Test_Wiki",
    ID: "200",
    valuepairs: [["WikiField","<div> HTML content..</div>"]], 
    completefunc: function (xData, Status) { 
        //trace('Trying to add data'); 
         window.console && console.log(xData.responseText);
The xData.responseText from each "UpdateListItems" service call appears to present a success status:
<?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:soap="" xmlns:xsi="" xmlns:xsd="">
            <UpdateListItemsResponse xmlns="">
                        <Result ID="1,Update">
                                ows_ContentType="Wiki Page" 
                                ows_Created="2017-02-24 20:57:19" 
                                ows_Author="1;#Lastname, fname" 
                                ows_Modified="2017-02-27 15:16:55" 
                                ows_Editor="1;#Lastname, fname" 
                                ows_FileRef="255;#sites/100/Test_Wiki/Test Article.aspx" 
With an "ErrorCode" of "0x00000000", the call appears to be successful, but when the Article is accessed using the Wiki Web page the WikiContent for the updated article has been flushed (empty).

Can anyone provide a recommended approach for updating content in a SharePoint Wiki. While the SharePoint Wiki appears to be similar to a document library (with fields such as "FileRef", "LinkFilename"), it does not appear that it is possible to upload a new document version as the "FileRef" is a reference to a SharePoint page, not specific content.

I would appreciate recommendations and if possible sample code.