Use GetList to retrieve document library template

Aug 9, 2013 at 9:15 PM
We have a bunch of internal SharePoint (2010) pages containing links to InfoPath forms integrated with K2 workflows. Far as I can tell, after K2 gets its hooks into the InfoPath form I don't have any control over the name of the xsn -- it gets published with a generic file name containing a date and time stamp. To get around this, especially when testing, I'd like to use GetList to retrieve the document library template (xsn) to insure I'm always getting the updated version of the form.

Using the example in the documentation I get a list of the nodes, but I can't figure out how to get the values. Does anyone have an example of a completefunc for the GetList operation?

Any help is appreciated. Thanks.

-Brian
Sep 3, 2013 at 7:16 PM
Figured it out. Used templateUrl to build the correct anchor. My page now always contains a link to the most current version of the InfoPath form.
function getTemplate() {
    $().SPServices({                                                    
        webURL: newURL,
        operation: "GetList",
        async: false,
        listName: "Test",
        CAMLRowLimit: 0,    
        completefunc: function(xData, Status) {
            var templateUrl = $(xData.responseXML).find('List').attr('DocTemplateUrl');
        }       
    });
} // end function
-Brian
Coordinator
Sep 3, 2013 at 7:50 PM
Brian:

Sorry I hadn't answered your query. Glad you worked it out anyway!

M.
Sep 3, 2013 at 9:01 PM

No worries Marc. Better for me I figured it out. You know how it goes… bang your head on it, move on to something else for a spell, come back later for your “aha” moment.