I need to get some data based on a key field from multiple lists. For this, I may need to do multiple API calls. Is there any way to avoid this ? To get all the data from multiple lists in a single API call ?
1 Answer
You could utilize SharePoint REST search API for that purpose, in particular to specify managed property in search query to return list items that contains value for that column.
Example
Assume we have site column named WorkspaceType
. Since SharePoint 2013 automatically creates managed property for site columns (you could follow this great article for a details) ,then we could construct the following search query to return items that contains value Team
:
/_api/search/query?querytext='WorkspaceTypeOWSCHCS:Team'
where WorkspaceTypeOWSCHCS
is the name of managed property.
-
-
-
How can we create a managed property with type as 'Multi Lookup' ? I can find the 'Text' and 'Y/N' types there. I have tried with the 'Text' type, but I'm not getting the results.– Anish VCommented Jun 5, 2014 at 13:33
-