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

# Data Services

> This article explains what data services are, how to define them, and how they are used in integration & automation and workflow design. Topics include configuring request fields, filtering data, defining sorting rules, and retrieving and consuming data services.

| **Feature**   | **Free plan** | **Basic edition** | **Professional edition** | **Dedicated-BI edition** |
| ------------- | ------------- | ----------------- | ------------------------ | ------------------------ |
| Data services | Not supported | Not supported     | Supported                | Supported                |

## What Is a Data Service?

A data service processes a dataset by selecting specific fields and exposing them as an API. Data services can currently be consumed only in Card nodes within integration & automation or workflow design.

<Note>
  **Notes:**

  * When you need multiple independent data metrics, maintain a separate data service for each and consume them individually in integration & automation.

  * Only the Super Admin and data admins can view and manage data services.

  * Permissions:

  * Consumption scope: In the "Retrieve single Record" or "Retrieve multiple Records" nodes of integration & automation or the simplified workflow designer, set the data source to Data Factory > Data Service to consume the data defined by the data service.
</Note>

## Define a Data Service

<Steps>
  <Step title="Go to Data Factory > Data Service and click Create Data Service to open the data service page." />

  <Step title="Configure the service as described below." />
</Steps>

Add the fields you want to include from the dataset. To make a field available for consumption in integration & automation or other features, select **Return**. You can also configure an aggregation method based on the field's Type (such as Count, Count unique values, Max, Min, Average, or Sum), and create Formula fields.

| **Type**                                                      | **Function**                                                                  |
| ------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| **Text**                                                      | No aggregation, Count (with or without deduplication)                         |
| **Date**                                                      | No aggregation, Count (with or without deduplication), Max, Min               |
| **Number**                                                    | No aggregation, Count (with or without deduplication), Max, Min, Average, Sum |
| **array (such as User or Department components)**<br /><br /> | Aggregation functions are not supported. Only "No aggregation" is available.  |

You can filter the data returned by the current data service.

Filter conditions support **fixed values**, **custom variables**, and **system variables**.

You can sort the data returned by the current data service.

3. Click **Confirm and preview** to verify the configuration.

## Retrieve a Data Service

Entry point: Integration & Automation > Simplified Workflow Designer > Retrieve Multiple Records node > Retrieve Single Record node > From Data Factory > Data Service.

Add a "Retrieve multiple Records" node in integration & automation. When the data source is set to **Data Factory** > **Data Service**, the node returns the aggregated data calculated by the data service.

## Consume a Data Service

> **Entry point: Send Card node or Update Card node in integration & automation or the simplified workflow designer. Bind the data returned by the data service to the card's data source.**

<Steps>
  <Step title="Open the card designer, select the loop metrics card, define the data source variable (an object array) and configure mock data. Then bind the metric value and metric name in the component attribute panel." />

  <Step title="Step 2">
    Add a Send Card node in the integration & automation workflow, select the cool data card you defined, and set the card's data source value to a field. The field can be sourced directly from the data returned by the "From Data Service" node in the previous step.
  </Step>
</Steps>
