> ## Documentation Index
> Fetch the complete documentation index at: https://docs.enterspeed.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 2 - Transforming data

All data transformation in Enterspeed is done from a set of schema definitions. Schemas are the glue that ties your existing data to your new layout.

So when designing your schema, you get to choose which of your existing data you wish to use in your new layout- and how it should be structured.

## How does it work?

You start by choosing which data sources you want to use (`triggers`).

Afterward, you begin designing your schema by mapping which data from your data sources you want to use, e.g., a *title*. The actual schema design is done in the `properties` object.

If you want to make your schema routable you define a [`route`](/enterspeed/reference/js/full-schema/routes). By defining a `route`, you can fetch it via the [Delivery API](/api-reference/delivery).

When you finish designing your schema, it's time to deploy it. Deploying the schema will automatically generate a **View** for each Source Entity Type.

<Info>
  A View is the actual data that has been transformed. If you have 10 Source Entity Types linked to your schema, this will generate 10 Views.
</Info>

Views will be generated if you:

* Deploy the schema again (this will regenerate all Views).
* A new Source Entity with the same type is available (this will only generate Views for the new Source Entities).
* A Source Entity gets Created, Updated, or Deleted via the Ingest API (This will affect the Views for the specific Source Entity).

## Example

Below is a simple example showing how a schema can look for transforming *source entities* with the type of `frontPage`.

<Tabs>
  <Tab title="Source entity">
    Given the `frontPage` source entity have the following content.

    ```json title="Source entity example" theme={null}
    {
      "id": "1044-en-us",
      "type": "frontPage",
      "url": "/frontPage",
      "properties": {
        "title": "Welcome"
      }
    }
    ```
  </Tab>

  <Tab title="Schema design">
    When designing your schema, you access the **title** property from the `sourceEntity`.

    You make the schema **routable** by using `routes` and using the `url` from the source entity.

    ```js title="Schema example" theme={null}
    /** @type {Enterspeed.FullSchema} */
    export default {
      triggers: function(context) {
        context.triggers('cms', ['frontpage'])
      },
      routes: function(sourceEntity, context) {
        context.url(sourceEntity.url)
      },
      properties: function (sourceEntity, context) {
        return {
          headline: sourceEntity.properties.title
        }
      }
    }
    ```
  </Tab>

  <Tab title="Output data">
    When querying the Delivery API with `url=/frontPage` the output will be:

    ```json title="Delivery API output example" theme={null}
    {
      "title": "Welcome"
    }
    ```
  </Tab>
</Tabs>

***Next, let's learning how to design a schema. [Go to designing a schema](/enterspeed/transform/designing-a-schema)***
