Work with dynamic items

Get a dynamic item

You can get a single item using the GetItem method of the IRestClient interface.

The following code gets a press release item by its ID:

NOTE: You can optionally get a field of the item or get it from a particular provider or culture.

Get a collection of dynamic items

You can get a collection of items using the GetItems method of the IRestClient interface.

The following code gets all items of type press release:

NOTE: You can optionally get specific fields of the press release items or get them from a particular provider or culture. You can also skip or take specified number of items in the collection.

Get a collection of dynamic items in order

You can get a collection of items using the GetItems method of the IRestClient interface and then order the collection by the value of a field.

The following code gets all items of type press release and orders it ascending by the title:

Get a filtered collection of dynamic items

You can get a collection of items using the GetItems method of the IRestClient interface and then filter the collection by the value of one or more fields.

The following code gets all items of type press release and filters it based on its title containg two specified values:

Get the parent type of a dynamic item

You can get a collection of items using the GetParent method of the IRestClient interface.

The following code gets the parent type of a an item by providing the item's type:

Create a dynamic item

You create items using the CreateItem method of the IRestClient interface.

The following code creates a press release item with title Sample title and sets the value of its MyCustomFieldName field to My custom field value:

NOTE: You can optionally provide a provider name, which will create the item in a specified provider.

Create dynamic items relations

You create items using the RelateItem method of the IRestClient interface.

The following code adds specific related data item to a specified field of a dynamic item:

Update an item

You update items using the UpdateItem method of the IRestClient interface.

The following code updates the title of the press release with the specified ID to Sample title and the value of its MyCustomFieldName field to My custom field value:

Delete an item

You delete items using the DeleteItem method of the IRestClient interface.

The following code deletes the press release with the specified ID:

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?

Next article

Taxonomies