For the complete documentation index, see llms.txt. This page is also available as Markdown.

Get Record

The Get Record interaction retrieves a Salesforce record and stores it into a record variable in your Dynamic Component.

Overview

The Get Record interaction fetches a single Salesforce record by its Id and stores it in a record variable in your Dynamic Component. This is the primary method for populating your component with a specific record that is not automatically available from the page context.

You can use this interaction to:

  • Retrieve details of a related record (e.g., getting the Parent Account details while on a Contact page).

  • Fetch a specific record based on a user's selection or input.

  • Refresh data after a record is updated to keep the UI up to date.


Configuration

The interaction has two parts: choosing the record variable that will store the result, and supplying the Id of the record to fetch.

1. Choose the Record Variable

Before configuring the interaction, you need a "container" to hold the record you retrieve.

  • Open the Variables panel (Database icon).

  • Create a New Variable (or select an existing one).

  • Data Type: Select Record (since you are fetching a single record).

  • Object: Select the object of the record you are fetching (e.g., Account).

  • API Name: Give it a clear name (e.g., parentAccountData).

Back in the interaction, set the Record Variable to this variable — it is where the retrieved record is stored.

2. Supply the Record Id

  • Add the interaction (e.g., to an On Load event or a Button On Click).

  • Action Type: Select Get Record.

  • Record Id: Provide the Id of the record to fetch. You can either:

    • Enter or map a specific Id (e.g., {!$Component.record.AccountId} — the Account Id from the current page), or

    • Reference the current page record so the interaction fetches the record the component is placed on.


Example

Goal: Display the "Parent Account's Industry" on a Case record page.

  1. Event: Select the component's On Load interaction.

  2. Action: Get Record.

  3. Record Id: {!$Component.record.AccountId} (the Account Id from the current Case).

  4. Record Variable: Store in {!parentAccountVar}.

  5. UI: Bind a Text Block or Input to {!parentAccountVar.Industry}.

Scenario B: Refetching Data After an Update

Goal: Refresh the component immediately after a user saves changes, ensuring they see the latest server-side values.

  1. Event: On the "Save" button, create a chain of actions.

  2. Action 1: Update Record (commits the changes).

  3. Action 2: Get Record.

    • Fetch the same record by its Id.

    • Store the result in the same record variable.

    • Result: The UI updates instantly because the variable driving it has been refreshed.


Important Considerations

Fetching by Id: This interaction fetches a single record by its Id. Make sure the Record Id you supply resolves to a valid record — an incorrect or empty Id returns no record.

Handling Empty Results: If no record matches the supplied Id, the record variable will remain null. You can handle this gracefully by adding a Condition interaction after the Get Record action:

  • If {!myVariable.Id} is empty: Show a "No record found" message or hide the section.

Field Accessibility: The interaction respects Salesforce security. You can only retrieve fields that the current user has permission to view in Salesforce.

Last updated

Was this helpful?