AI agents: the content index is at /llms.txt. Every page is also available as Markdown — send the request header Accept: text/markdown, or append .md to the page URL.
Xperience Docs

Cookie consent

We use necessary cookies (opens in a new tab) to run our website and improve your experience while browsing. Additional cookies are only used with your consent. You may revoke your consent on the Cookies Policy (opens in a new tab) page or in your browser at any time.

Configure (opens in a new tab)
  • Documentation
    InstallationUsing the Xperience interfaceDeveloping websitesConfiguring XperienceManaging usersSecuring websitesDeploying websitesManaging website contentMultilingual websitesMacro expressionsExternal utilitiesIntegrating 3rd party systemsCustom developmentE-commerce featuresOn-line marketing featuresRelease notes - Xperience 13Xperience terminology glossary
  • Tutorial
    Using the Xperience interfaceDeveloper tutorialBusiness tutorialResource hub for marketers
  • API Examples
    ConfigurationContent managementDevelopmentE-commerceOn-line marketingSocial media
  1. Home
  2. Developing websites
  3. Retrieving content

Retrieving content


Was this page helpful?

Send us feedback Go back to top
  • Community Questions & Answers (opens in a new tab)
  • Contact support (opens in a new tab)

This section describes how to retrieve data from Xperience. You can work with the following system objects:

  • Pages
  • Page attachments
  • Form records
  • Custom table items
  • Custom module classes
  • Media library files

Retrieving form, custom table, and custom module data

Forms, custom tables, and custom modules all use the same process for retrieving stored entries from their corresponding database tables. To retrieve content from these objects, include their generated classes into your solution and use their API in the code in your application.

Retrieving form data

When retrieving forms data, use BizFormItemProvider and the generated <FormCodeName>Item class. BizFormItemProvider supplies two methods to facilitate form data retrieval:

  • GetItem<TType> –returns a record of the specified type and ID.
  • GetItems<TType> – returns all records of the specified type using the ObjectQuery API.

The following example demonstrates how to retrieve individual submissions from a 'Contact Us' form. The code uses the ContactUsItem class generated via the form's Code tab to work with individual submitted entries.

C#
// Gets all form items of the given type
IEnumerable<ContactUsItem> items = BizFormItemProvider.GetItems<ContactUsItem>();

// Gets a single form item with the given type and ID
ContactUsItem item = BizFormItemProvider.GetItem<ContactUsItem>(1);

Retrieving custom table data

When retrieving custom table data, use CustomTableItemProviderand the generated <CustomTableCodeName>Item class. CustomTableItemProviderprovides two methods to facilitate form data retrieval:

  • GetItem<TType>–returns a record of the specified type and ID.
  • GetItems<TType> – returns all records of the specified type using the ObjectQuery API.

The following example demonstrates how to retrieve individual records from a custom table called 'Sample table'. The code uses the SampleTableItem class generated via the custom table's Code tab to work with individual submitted entries.

C#
// Gets all custom table items
IEnumerable<SampleTableItem> items = CustomTableItemProvider.GetItems<SampleTableItem>();

// Gets a single custom table item for a given custom table item ID
SampleTableItem item = CustomTableItemProvider.GetItem<SampleTableItem>(1);

Retrieving custom module data

To retrieve data from custom module classes, generate their corresponding Class>Info, <Class>InfoProvider, and I<Class>InfoProvider classes.

See the Creating custom modules page for information on creating custom module classes and generating classes to work with them in your application.

Then use the corresponding IInfoProvider service and its Get method to retrieve the module class data (ObjectQuery API).

The following example shows how to get items from a sample Office module.

C#
// Gets all custom module class items
IEnumerable<OfficeInfo> items = OfficeInfo.Provider.Get();

Related pages

  • Generating classes for Xperience objects
  • Displaying page attachments
  • Working with pages in the API