> ## 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.

# Association Query

> Learn how to use the Association Query component in forms, including use cases, feature descriptions, field attributes, and precautions. The component enables efficient data queries and display, and applies to scenarios such as HR OA management systems and other data lookups.

## Use Cases

Query data from other forms within a core form. Applies to a wide range of data lookup scenarios, such as:

● In HR OA management systems, view your own employee records, Meeting reservation records, attendance records, and other data on the Profile home page.

| **Before (complex configuration, record limit, no nested queries)**<br />For example, the raw material table linked to "Product" is currently implemented as a subform. **The subform is capped at 500 records**, and **subforms cannot be further nested with associated subforms.** | **After (simple, direct, efficient, easy to understand, higher data capacity, supports recursive nested queries)**<br />Reference the "Association Query" component directly to retrieve and display details from the associated table. There is no need to configure Default value data linkage for each field in the subform. This improves Best practices configuration efficiency, reduces operational and cognitive overhead, and supports Association Queries on subform data. |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |

### 1. Field Overview

Association Query is a standalone query and display feature. It automatically retrieves one or more records from other forms without saving them to the database.

**Component usage scope:**

1. Supported in all editions of YiDA (cross-platform compatible).
2. Applies to YiDA regular form and workflow form page types. Not currently supported on custom pages.
3. Because of how this component works, it is intended for pure data lookup or view scenarios that do not require submitting Data to the database. As a result, the component is currently available only on the form detail page. Other feature surfaces (such as the data management page) do not expose this component at this time.
4. Show/hide logic in components such as dropdown Select and dropdown Multiselect can reference the "Association Query component".

### 2. Field Attributes

#### 2.0 General Attributes

General attributes of the Association Query component include:

1. Title
2. Status: Normal / Read-only / Hidden
3. Content shown when there is no data: Custom supported

#### 2.1 Association Attributes

Select an associated form. Both same-app and cross-App associations are supported.

#### 2.2 Show Field

<Steps>
  <Step title="Show field: retrieve and display fields from a target associated form via Association Query" />

  <Step title="Added Show fields support Sort, Rename, Delete, and other actions" />
</Steps>

#### 2.3 Data Filtering

Apply filters to the records returned by the Association Query. Records that match the Filter conditions appear in the corresponding fields.

#### 2.4 Number of Records Displayed

Choose how Association Query results are displayed: "Single record" or "Multiple records".

a. "Single record": Suited for associated detail lookups. Displays the most recently submitted record in submission order.

b. "Multiple records": Suited for associated list lookups. All records that meet the Filter and other constraints appear together in the List.

i. When the associated form is a workflow form, only records with an instance status of "Completed" can be queried.

#### 2.5 Associated Table Actions

When the associated form has no data, if the display mode is set to "Multiple records", select "Allow record creation" for the associated table. Records can then be added directly to the target form from within the List.

⚠️ Note: If the current associated form is a workflow form, adding records is not supported, and only records with a status of "Completed" are displayed.

### 3. Notes

1. The Association Query List displays at most 5,000 records.

2. When querying workflow form data via Association Query, only records whose workflow status is Completed are returned.

3. Public access cannot be enabled while this Component is present on a Page.

4. Records returned by the Association Component inherit the scope of the form's field permissions and Data Permissions.

5. If the associated form has been deleted, an error message appears:
