# Target Page Object

The **Target Page Object** tells your Dynamic Component which Salesforce object it's working with — for example, `Account`, `Contact`, `Opportunity`, or `My_Custom_Object__c`. This setting is what connects the component to live record data when it's placed on a record page

{% embed url="<https://youtu.be/e5Nc96s1kCA>" %}

***

## How to Set It

You can set the Target Page Object in two places:

### *When creating a new component*

The creation dialog includes a Target Page Object dropdown. Select the object before finishing setup.

<figure><img src="/files/HsWP4u6DDM6JGrjABG6R" alt=""><figcaption></figcaption></figure>

### *In an existing component*

Open the component in the Component Builder, click the Settings icon (⚙️, top-right), and select the object from the Target Page Object dropdown. Save when done.

<figure><img src="/files/j7yX10mTberlMMlQkTIK" alt=""><figcaption></figcaption></figure>

***

## Why is the Target Page Name Important?

<table><thead><tr><th width="249.91796875">Effect</th><th>Details</th></tr></thead><tbody><tr><td>Populates the Fields tab</td><td>The left-panel Fields tab loads all fields from the selected object, letting you drag fields directly onto the canvas as data-bound components.</td></tr><tr><td>Enables <code>$Component.record</code></td><td>On a record page, when the Target Page Object matches the page's object type, the <code>$Component.record</code> variable becomes available — giving you direct access to field values like <code>$Component.record.Name</code> or <code>$Component.record.Id</code>.</td></tr><tr><td>Simplifies related data</td><td>With <code>$Component.record.Id</code> available, you can easily filter queries to show related records — for example, Contacts belonging to the current Account.</td></tr></tbody></table>

<figure><img src="/files/RTqasNoEAYOlXsTDmRnN" alt="" width="346"><figcaption></figcaption></figure>

***

## When to Use the Target Page Name

Set the Target Page Object whenever your component is placed on a record page and needs access to that record's data — Account pages, Contact pages, Opportunity pages, and so on. This covers the large majority of use cases.

***

## When You Might *Not* Need It

If your component doesn't need a specific record's context — **for example, a dashboard on an App Page pulling org-wide data** — you can leave this unset and use an Avonni Query Data Source to fetch data directly. Similarly, if a component receives a record ID as an input variable (such as when launched in a modal), you may not need the Target Page Object for data access, though setting it still helps populate the Fields tab.

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.avonnicomponents.com/dynamic-components/core-concepts/target-page-object.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
