---
schema_version: "1"
id: 5563dcfb5884d042ea5df06a5a645682ae87ff601bfd791d6f505aebd14b25ec
title: Using Data Functions
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/siteforce_data_function.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.siteforce_data_function.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: de0ee006528622e3da9f48b2d8483574932e9cc5902e9e78a7ab032bd627a84e
description: A data function lets you connect to a standard or custom Salesforce object, perform calculations on the returned results, and display the calculation on the page. For example, for a particular field in an object, you can use a data function to calculate the total value or the average amount of all returned records.
products:
  - Salesforce Platform
  - Security
release: "264"
---
# Using Data Functions

A data function lets you connect to a standard or custom Salesforce object, perform calculations on the returned results, and display the calculation on the page. For example, for a particular field in an object, you can use a data function to calculate the total value or the average amount of all returned records.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition">
        <colgroup>
          <col>
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">Available in: Salesforce Classic</td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">
              <p>Available for purchase in: <strong>Enterprise</strong>, <strong>Performance</strong>,
                and <strong>Unlimited</strong> Editions</p>
              <p style="margin-bottom:0;">Available (with limitations) in:
                <strong>Developer</strong> Edition
              </p>
            </td>

          </tr>
        </tbody>
      </table> <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d139212e74">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d139212e74 ">To build, edit, and manage Site.com
              sites:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d139212e74 ">
              <p><samp class="parmname">Site.com Publisher
                  User</samp> field enabled on the user detail
                page</p>
              <p>AND</p>
              <p style="margin-bottom:0;">Site administrator or designer
                role assigned at the site level</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d139212e74 ">To edit the guest user profile:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d139212e74 ">
              <p><samp class="parmname">Site.com Publisher
                  User</samp> field enabled on the user detail
                page</p>
              <p>AND</p>
              <p>Site administrator or designer
                role assigned at the site
                level</p>
              <p>AND</p>
              <p>Manage Profiles and
                Permission Sets</p>
              <p>AND</p>
              <p style="margin-bottom:0;">Customize
                Application</p>
            </td>

          </tr>
        </tbody>
      </table>

To add a data function to a page:

1. Drag a **Data Function** from the Page Elements pane onto the page.
2. Select the object that you want to connect to.
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_note.png)
    
    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](https://help.salesforce.com/s/articleView?id=platform.siteforce_data_access_perms.htm&release=264.0.0&type=5 "Sites built with Site.com are publicly available, so visitors access the site via the Guest User license that's associated with the site."), 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.
3. Optionally, in Filters, select criteria to filter your data set. If you don't select any criteria, all the data from the item is returned.
    
    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](https://help.salesforce.com/s/articleView?id=platform.siteforce_data_operators.htm&release=264.0.0&type=5) to control how results are filtered. For example, select Equals to return an exact match.
    3. Select [the source](https://help.salesforce.com/s/articleView?id=platform.siteforce_data_operators.htm&release=264.0.0&type=5) 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](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_note.png)
    
    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**.
4. In Functions, select a function:
    
     
    | Option | Description |
    | --- | --- |
    | Count | Counts the number of records that contain a value for the selected field. For example, if an object contains 30 records, but only 25 records have a value in the field you specify, the result is 25. |
    | Maximum | Returns the highest value of all the values for the selected field. Applies to numbers, strings, and dates. |
    | Average | Calculates the average value of all records for the selected field. For example, if you have 20 records with a total value of $20,000 in the Price field, the average is $1,000. Only applicable to fields that contain numbers. |
    | Minimum | Returns the lowest value of all the values for the selected field. Applies to numbers, strings, and dates. |
    | Sum | Calculates the total value of all records for the selected field. |
5. Select the field it applies to.
6. Click **Save**.

#### See Also

- [The Default, Error, and No Data Views](https://help.salesforce.com/s/articleView?id=platform.siteforce_data_views.htm&release=264.0.0&type=5 "When working with data repeaters, data tables, data functions, and forms, you can customize what your site visitors see if an error occurs when connecting to the data source.")
- [Improve Performance Using Caching](https://help.salesforce.com/s/articleView?id=platform.siteforce_data_caching.htm&release=264.0.0&type=5 "When working with data-bound page elements, such as data repeaters, data tables, and data functions, you can improve the performance and page rendering of your website using caching. Caching controls how often a page containing a data connection requests data from Salesforce.")
- [Data Filter Examples](https://help.salesforce.com/s/articleView?id=platform.siteforce_data_repeater_examples.htm&release=264.0.0&type=5 "When working with data repeaters, data tables, and data functions, you can filter the data you retrieve in many ways. In this topic, we explore two options— fixed values and URL query strings—to illustrate some common filtering techniques.")