Retrieving Data with Page Data Connections

Use a page data connection to create a detail page for a single record when working with Salesforce objects.

Required Editions

Available in: Salesforce Classic

Available for purchase in: Enterprise, Performance, and Unlimited Editions

Available (with limitations) in: Developer Edition

User Permissions Needed
To build, edit, and manage Site.com sites:

Site.com Publisher User field enabled on the user detail page

AND

Site administrator or designer role assigned at the site level

To edit the guest user profile:

Site.com Publisher User field enabled on the user detail page

AND

Site administrator or designer role assigned at the site level

AND

Manage Profiles and Permission Sets

AND

Customize Application

When combined with data elements, custom code, or content blocks, page data connections let you connect to standard and custom objects, retrieve a specific record, and dynamically display the returned data anywhere on the page. You can even use expressions to access the returned data in the page's properties.

When the page is open:

  1. Ensure that the page is selected in the Page Structure pane.
  2. Click Add Connection in the Page Data Connection section of the Properties pane.
  3. Select the object that you want to connect to.
    Note
    Note
    • For Site.com users, the drop-down list only displays objects that are available to guest users because site visitors access your public site via the Guest User license. To make other objects available, go to the guest user profile, enable the relevant object's “Read” permission, and refresh the list.
    • For Communities users, the drop-down list displays objects that may not be available to site visitors. For authenticated visitors, object access on public and private pages is controlled by their user profiles. For unauthenticated visitors, object access on public pages is controlled by the site's guest user profile.
  4. Optionally, in Filters, select criteria to filter which record is returned. If you don't select any criteria, the first record is returned by default.
    1. Select the field to which the filter criteria apply. The Field drop-down list displays the object's fields, followed by the fields of all parent objects, which use the format parent_object_name.field_name.
    2. Select the operator to control how results are filtered. For example, select Equals to return an exact match.
    3. Select the source of the filter value. For example, to specify an explicit value, select Fixed value, or to use the values passed to the page via a query string, select URL query string.
    4. Set the value of the filter. If you're using a query string, you can also specify what should happen if the query string is missing.
    5. Add additional filter criteria as required to narrow your results further. Each filter item is combined with an AND operator.
    Note
    Note If you're using a fixed value to filter the results, you can view the returned records in the Connection Preview section. To refresh the list of records, click Reload Preview.
  5. In Sorting, you can specify whether to sort the results by one or more fields in ascending or descending order.
    For example, say you want to create a page that displays the most popular movie. You could connect to a custom object that contains movie data, and instead of using filter criteria, you could sort by user rating in descending order. Because a page data connection returns a single record, only the highest rated movie is returned.
  6. Click Save.

Next, you must add either data elements, custom code, or content blocks to the page to display the retrieved record data.

You can use expressions to access the returned data anywhere on the page, including the page's properties. For example, let's say you want to use the account name as the title of the Account Detail page. In this case, you would simply enter {!Name} in the Title field on the Properties pane. When the page loads, it retrieves the account name for that particular record and displays it in the browser's title bar.