3

I am looking for a way to use the REST API to return specific fields of a specific content type so that I can bind it to a table.

It seems the List API is used against a specific List but in my case I want to search all lists and return only a specific content type that I have defined in the site collection. Additionally I want it to return 4 specific fields of that content type so I can bind it to a table.

0

Use the Search API with a property restriction of

 ContentType:[Your_CTYPE_Here]
  • But how do I get my 4 specific fields to also be returned? I need to bind them all to a table. – ChiliYago Mar 14 '14 at 20:23
  • Did you read the link I provided? The "SelectProperties" query parameter? – Paul Schaeflein Mar 15 '14 at 23:41
5

REST request to retrieve fields in Content Type

The following example demonstrates how to return all fields in Task Content Type:

/_api/web/contenttypes/getById('0x0108')/fields

REST request to retrieve specific fields in Content Type

The following example demonstrates how to return Title, AssignedTo, TaskDueDate and TaskStatus fields in Task Content Type:

/_api/web/contenttypes/getById('0x0108')/fields?$filter=(InternalName eq 'Title') or (InternalName eq 'AssignedTo') or (InternalName eq 'TaskDueDate') or (InternalName eq 'TaskStatus')

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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