2

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 1

3

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.

4
  • Will it work with multi lookup columns ?
    – Anish V
    Commented Jun 4, 2014 at 12:42
  • Sure, I've tested it with a multi lookup column. Commented Jun 4, 2014 at 12:50
  • 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 V
    Commented Jun 5, 2014 at 13:33
  • It's treated the same as text type. Commented Nov 24, 2014 at 18:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.