--- title: Computed fields slug: '2251' canonical_url: https://docs.coveo.com/en/2251/ collection: coveo-for-sitecore-v5 source_format: adoc --- # Computed fields Sometimes, recording information in a Sitecore template field isn't practical, time-consuming, or error prone. If you need to store complementary information in your [Coveo Platform](https://docs.coveo.com/en/186/) source items and this information can be determined using the same recipe from one item to the next, consider using a computed field instead. Sitecore gives you the ability to create computed fields programmatically at indexing time using [custom C# code and field configurations](https://doc.sitecore.com/xp/en/developers/100/platform-administration-and-architecture/create-a-computed-index-field.html). Coveo for Sitecore simplifies the process of adding computed fields to your Coveo indexes by doing part of this work. > **Note** > > In the **Fields** page of the **Command Center**, the **Computed** tab displays all computed fields you add or create, along with Sitecore's own computed fields. > > ![Image showing sample content of Computed fields in the Command Center | Coveo for Sitecore 5](:https://docs.coveo.com/en/assets/images/c4sc-v5/computed-fields-in-command-center.png) Coveo for Sitecore supports two main computed field implementation scenarios: * [Adding out-of-the-box Coveo for Sitecore computed fields](#using-coveo-for-sitecore-out-of-the-box-computed-fields). * [Creating and adding your own computed fields](#implementing-a-computed-field-of-your-own) to your [Coveo organization](https://docs.coveo.com/en/185/) indexes. ## Using Coveo for Sitecore out-of-the-box computed fields Coveo for Sitecore includes out-of-the-box implementations that let you add computed fields for common use cases without any coding on your part. Coveo for Sitecore also provides commented out field indexing configurations for these computed fields in the `Coveo.SearchProvider.Custom.config` file, in the `` section. You only need to provide a few attribute values and enable the configuration to have your computed fields added on indexing. > **Note** > > This configuration lets you create and index the computed field. > To apply special settings to that field (for example, to use it as a facet or to sort results), you also need to [add a configuration in the `fieldNames` section](https://docs.coveo.com/en/2166/) of the configuration file. ### Related articles * **[Use out-of-the-box computed fields](https://docs.coveo.com/en/2623/)** This article explains how to use the three Coveo for Sitecore computed field implementations (that is, `ImageUrlComputedField`, `ImageAltComputedField`, and `ReferencedFieldComputedField`). * **[Create a computed field for a referenced item](https://docs.coveo.com/en/2238/)** This article provides an example showing how to use the out-of-the-box `ReferencedFieldComputedField` computed field. `ReferencedFieldComputedField` is used to populate a `departureairportcity` field in _Flight_ items by retrieving the content of a `City` field from a referenced _Airport_ item. ## Implementing a computed field of your own In this scenario, you'll need to code the logic of your computed field. Coveo for Sitecore provides a computed field configuration element structure. Minimal configuration is required to have your computed field added on indexing. > **Warning** > > When running computed field code, check your logs for computed field errors indicating items aren't being indexed. > Implement proper exception handling to avoid these issues. > For example, you might want to stop the process or set a fallback value for a computed field when suitable. ### Related articles * **[Implement and configure a computed field in your index](https://docs.coveo.com/en/2320/)** This article gives you complete step-by-step instructions on how to add your own computed fields in Coveo index items, from setting up your C# project to using your computed fields in search interfaces. * **[Create a computed date field](https://docs.coveo.com/en/2237/)** This article is an example showing how to create a computed archive date based on the item creation date. * **[Pass custom parameters](https://docs.coveo.com/en/2410/)** This article is a continuation of the [Create a computed date field](https://docs.coveo.com/en/2237/) example. The implementation is modified to retrieve and use a value from the configuration to compute the item archive date.