restsharepointfilter

SharePoint REST API Filter for Createdby


I have inherited a JSOM app that takes a people picker and is suppose to return all items created by a selected user.

The call is below:

https://sitex/sites/_vti_bin/listdata.svc/CPSEDailyReportPictureLibrary?$expand=CreatedBy&$filter=((CreatedBy/Name eq 'Ken Jasper'))&$orderby=Created desc&$top=40&$skip=0&$inlinecount=allpages

Can you please help. Thanks


Solution

  • Field name is not CreatedBy, it is Author

    Try this:

    https://yoursite/_api/web/lists/GetByTitle('CPSEDailyReportPictureLibrary')/items?$select=ID,Title,Author/Title&$filter=Author/Title eq 'Ken Jasper'&$expand=Author&$orderby=Created desc&$top=40&$skip=0&$inlinecount=allpages