Monday, February 25, 2019

Getting Look up values using Rest API Call - SP Online

Hello All

This is a short description about how to get the look up column values using reapi calls
In my scenario, I have two list.

1. Employee
2.State

Employee has a field Names State which is a look up value from another custom list 'State'.

The normal rest api call only returns the ID , to get the details from the look up list we need to use the below format.

<yoursite url> + _api/web/lists/GetByTitle('ListName')/Items?$select=State/State,EmployeeName&$expand=State

Hope this helps.

Regards,
Saveesh.S

Tuesday, April 16, 2013

Sharepoint LIst Name in REST Services.



In SharePoint 2010 , if you are creating a list with special characters in its name, it not through any error , but it will trim the characters excluding space(%20) and _. 

IF you are using rest services dynamically, it will be very help full to generate the list name.
Event the ctx object created by OOB can be leveraged to find the name of the list by using the following parameters.

Please find the below example
If I am creating a list with name sam~!@#$%^&*()_+=-` the list name in the url will be sam_ and the same can be used in REST services to pull the data from  SharePoint .

Friday, March 11, 2011

Querying the document library which has folders in it

In MOSS , to query a document library which has sub folders.You need to set the ViewAttributes property of the SPQuery object to Scope="Recursive"

The following code illustrates the same.

SPSite site = new SPSite(");
SPWeb web = site.OpenWeb();
SPList lst = web.Lists["testDocu"];
SPQuery qry = new SPQuery();
qry.Query =" <Query> <Where> <Lt> <FieldRef Name=\"Created\" /> <Value IncludeTimeValue=\"TRUE\" Type=\"DateTime\"> 2011-03-11T00:23:43Z </Value> </Lt> </Where> < /Query> ";
qry.ViewAttributes = "Scope=\"Recursive\"";
SPListItemCollection itmcln = lst.GetItems(qry);
foreach (SPListItem itm in itmcln)
{
       Console.WriteLine(itm.Name.ToString());
}


Thursday, August 27, 2009

Creating Shared Service Provider in Sharepoint2007(MOSS)

Step1. Start Office SharePoint Server Search and Windows SharePoint Services Help Search in the Operations tab of the central admin

Step2 . We can Either create the SSP through central admin as well as through the stsadm command
Here I am using the stsadm command to create the ssp.
For Creating an SSP We need one top level site and a my site.
The following are the commands to create top level sites. Here I am using top level sites for both my site and the site for SSP.

For SSP
stsadm.exe -o extendvs -url http://sysname:8080/ -ownerlogin domain\username -owneremail name@comp.com -exclusivelyusentlm -databaseserver dbservername -databasename databasename -donotcreatesite -apcreatenew -apidname Mysite_sam_ssp_apppool -apidtype configurableid -apidlogin domain\username -apidpwd *****

For My Site

stsadm.exe -o extendvs -url http://sysname:8081/ -ownerlogin domain\username -owneremail name@comp.com -exclusivelyusentlm -databaseserver dbservername -databasename databasename -donotcreatesite -apcreatenew -apidname Mysite_sam_ssp_apppool -apidtype configurableid -apidlogin domain\username -apidpwd *****

Step3.Creating SSP

stsadm -o createssp -title "SSP_sam" -url "http://sysname:8080/" -mysiteurl ""http://sysname:8081/" -ssplogin "domain\username" -indexserver "sysname" -indexlocation "D:\Index" -ssppassword "*****" -sspdatabaseserver "dbServerName" -sspdatabasename "sspDB_sam_DB"

After successfully executing these commands you can go and check SSP