> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/dynamic-components/core-concepts/target-page-object.md).

# 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="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2Fgit-blob-474dbc9c173aac56f6fb1b2dbaf123fdeddb7b65%2F2025-05-06_19-47-12.png?alt=media" 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="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2Fgit-blob-11a40d871d565290792f71ae1e6a57ce947b8dca%2F2025-04-22_15-46-49.png?alt=media" 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="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2Fgit-blob-74b174533411ee7864d11fbae07e1e796ab3eef5%2F2025-03-13_20-33-49%20(1).png?alt=media" 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
