Thursday, March 6, 2014

Read a list column value using SP services in SharePoint

How can i read  a column value value of a share point list using Jquery and SP services

This can be achieved by the following java script function .

Make sure in your JS page you have refered the jquery and spservices link
//read the tiltle field value of ABC list
function ReadColumnValue()
{

var myvalue=null;
var strViewfields = "<ViewFields><FieldRef Name='Title'/></ViewFields>";
$().SPServices({
webURL: strSiteURL,
            operation: "GetListItems",
            async: false,
            listName: "ABC",

            completefunc: function (xData, Status) {
                $(xData.responseXML).SPFilterNode("z:row").each(function () {
               
if($(this).attr("ows_title")!= undefined)
{

       myvalue=$(this).attr("ows_title");


}
                });
            }

        });



the variable myvalue will containt eh list column value of the tilte field of the AB list




No comments:

Post a Comment

Rename a Web Application in Sharepoint : A solution using powershell

Here is a small script that will enable you all to change a SharePoint Web Application name . We can use the following SharePoint Pow...