---
schema_version: "1"
id: 9f0fe2617c29dd2dc59ba4f7c4908e38d711181498c4864d099d6a44a604b1dd
title: Define Syndication Feeds
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/feeds_creating.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.feeds_creating.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: ad76ef1cce38585b789e6648f11e095cff7ac8d78a86cbe9ce6e489eefc1b8cf
description: Syndication feeds give users the ability to subscribe to changes within Salesforce Sites and receive updates in external news readers. Simply by defining a SOQL query and mapping, you can syndicate changes to public data to your end users. You can create one or more syndication feeds for your organization's public sites or any Visualforce page. The syndication feed displays the records specified by a SOQL query. Users can subscribe to the feed and view the feed when they visit the site or page.
products:
  - Salesforce Platform
  - Security
release: "264"
---
# Define Syndication Feeds

Syndication feeds give users the ability to subscribe to changes within Salesforce Sites and receive updates in external news readers. Simply by defining a SOQL query and mapping, you can syndicate changes to public data to your end users. You can create one or more syndication feeds for your organization's public sites or any Visualforce page. The syndication feed displays the records specified by a SOQL query. Users can subscribe to the feed and view the feed when they visit the site or page.

### 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: both Salesforce Classic and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Developer</strong>, <strong>Enterprise</strong>, <strong>Performance</strong>, and <strong>Unlimited</strong> Editions</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="d156799e72">User Permissions
            Needed</th>
        </tr>
      </thead>
      <tbody>
        <tr class="">
          <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e72 ">Create, edit, or delete a feed definition:</td>

          <td class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e72 ">Modify All Data</td>

        </tr>
        <tr class="">
          <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e72 ">Subscribe to a feed</td>

          <td class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e72 ">No special user permission required</td>

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

Define a syndication feed, including what records are returned, and which data from the records is displayed:

- Name—A descriptive name for this feed, which distinguishes it from other feeds you may create. Use only letters, numbers, or the underscore character “\_”. Do not use more than one underscore character in a row.
- Description—Describe the feed. For example, “Account first name, last name, and region for the last ten accounts created or edited.”
- Query—The SOQL query that defines which records are returned to the syndication feed. To ensure fast performance, some limitations on the SOQL query are imposed.
    
    - If the SOQL query does not specify a limit, then no more than 20 records are returned.
    - Query limits can't exceed 200 results. If you make a query with a limit beyond this number, only the first 200 records are returned.
    - If the SOQL query does not have an ORDER BY value specified, records are ordered by the LastModifiedDate value if there is one, or by SystemModstamp value if not.
    - `COUNT` is not supported.
    - Aggregate queries are not supported. For example, this query cannot be used in a syndication feeds SOQL query:
        
        ```sql
        SELECT Name, (SELECT CreatedBy.Name FROM Notes) FROM Account
        ```
    - You can use bind variables, a variable whose value is supplied in the URL.
    
    ![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 The guest user must have appropriate sharing and field-level security access or you cannot save your query, because the Lightning platform verifies access and sharing before saving.
- Mapping—Because syndication feeds use the ATOM web publishing protocol, you must provide a mapping value that matches objects and fields on the returned records with ATOM constructs. Note that all values must be string literals.
    
    You can also use bind variables, a variable whose value is supplied in the URL. For more information, see [ATOM-Object Mapping](https://help.salesforce.com/s/articleView?id=platform.feeds_creating.htm&release=264.0.0&type=5)
- Max Cache Age Seconds—Because many users may access a feed at the same time, Salesforce caches the feed data, for 3600 seconds by default. You can modify this to a minimum of 300 seconds, or for as long as you wish. Query results that are older than the time specified here are dropped, and a new query is run on the next request for that information, that is, the next time a user opens a page containing a feed that they have subscribed to.
- Active—Select this checkbox to make the feed available for subscription. Once a feed is active, users have the option of subscribing to it.

## ATOM-Object Mapping

You must specify a mapping in the syndication feed definition. The mapping relates ATOM constructs such as entry title to the corresponding value in a record, for example, “Account Name.” A full set of mappings represents a news feed, and the query represents the content of each news item in a feed. For example, Lead records created today or Contacts with updated Account information.

A feed element is the envelope for each part of a news item, and an entry element is the contents of the envelope.

Mapping also allows you to apply short labels to various fields for display purposes.

The following table lists each ATOM and object element and explains what values should be provided:

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:14.285714285714285%">
          <col style="width:14.285714285714285%">
          <col style="width:71.42857142857143%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d156799e207">Feed Element</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d156799e210">Entry Element</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d156799e213">Description</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Feed Element" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e207 ">
              <code>fa</code>
            </td>

            <td data-label="Entry Element" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e210 ">&nbsp;</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e213 ">Required only if <code>ea</code> (entry
              author) is not specified. Feed author. For example, <code>fa:"Acme Feed Author Admin Mary"</code>
              shows the feed author as Admin Mary.</td>

          </tr>
          <tr class="">
            <td data-label="Feed Element" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e207 ">
              <code>fid</code>
            </td>

            <td data-label="Entry Element" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e210 ">&nbsp;</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e213 ">Optional (because default value is supplied). Id of the feed. By
              default, this value is the public site URL. If you specify a value,
              it must be a valid internationalized resource identifier
              (<dfn>IRI</dfn>). An IRI is a URL generalized to allow the use
              of Unicode.</td>

          </tr>
          <tr class="">
            <td data-label="Feed Element" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e207 ">
              <code>fl</code>
            </td>

            <td data-label="Entry Element" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e210 ">&nbsp;</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e213 ">Optional (because default value is supplied). Feed link. For
              example, <code>fl:"https://www.salesforce.com"</code>. News readers usually
              interpret this element by linking the feed title to this
              URL.</td>

          </tr>
          <tr class="">
            <td data-label="Feed Element" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e207 ">
              <code>fst</code>
            </td>

            <td data-label="Entry Element" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e210 ">&nbsp;</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e213 ">Optional. Feed subtitle. For example, <code>&amp;map=ft:"Newest Opportunities",fst:"Western
                                    Division"</code> shows the feed title Newest Opportunities and
              subtitle Western Division.</td>

          </tr>
          <tr class="">
            <td data-label="Feed Element" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e207 ">
              <code>ft</code>
            </td>

            <td data-label="Entry Element" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e210 ">&nbsp;</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e213 ">Required. Feed title. For example, <code>ft:"Newest Opportunities"</code>.</td>

          </tr>

          <tr class="">
            <td data-label="Feed Element" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e207 ">&nbsp;</td>

            <td data-label="Entry Element" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e210 ">
              <code>ea</code>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e213 ">Required only if <code>fa</code> (feed
              author) is not specified. Entry author. For example, <code>ea:"Account created by: " +
                                    Account.CreatedBy </code>.</td>

          </tr>
          <tr class="">
            <td data-label="Feed Element" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e207 ">&nbsp;</td>

            <td data-label="Entry Element" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e210 ">
              <code>ec</code>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e213 ">
              <p>Required. Entry content. For example,<code>ec:"description for " Name "&lt;br&gt;" Description</code> shows
                the value of the <samp class="parmname">Name</samp> field with additional
                text. The output of a feed for this example resembles the
                following:</p>
              <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>description for Ajax Industries Description</code></pre>
            </td>

          </tr>
          <tr class="">
            <td data-label="Feed Element" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e207 ">&nbsp;</td>

            <td data-label="Entry Element" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e210 ">
              <code>ect</code>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e213 ">Optional. Entry content of type <code>text</code>, <code>html</code>, or
              <code>xhtml</code>. For example, <code>ect: html</code> for HTML content. Default
              is <code>text</code>.
            </td>

          </tr>
          <tr class="">
            <td data-label="Feed Element" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e207 ">&nbsp;</td>

            <td data-label="Entry Element" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e210 ">
              <code>el</code>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e213 ">Optional. Entry link. Must be a valid URI. This value is usually
              a link to another representation of the content for the entry. For
              example, the link could be to a record in the Salesforce user
              interface. News readers usually interpret this element by linking
              the entry title to this URL For example, <code>el:"Account.URl"</code>.</td>

          </tr>
          <tr class="">
            <td data-label="Feed Element" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e207 ">&nbsp;</td>

            <td data-label="Entry Element" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e210 ">
              <code>es</code>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e213 ">
              <p>Optional. Entry summary. An optional summary of the entry
                content. For example, <code>et: Account.Name,
                                    es: Account.Name + "’s account number, website, and
                                    description", ec: Account.AccountNumber + " " + Account.Website
                                    + “ “ + Account.Description </code></p>
              <p style="margin-bottom:0;">If not
                specified, news readers display the content defined using the
                <code>ec</code> element.
              </p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Feed Element" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e207 ">&nbsp;</td>

            <td data-label="Entry Element" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e210 ">
              <code>est</code>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e213 ">Optional. Entry summary of type <code>text</code>, <code>html</code>, or
              <code>xhtml</code>. For example, <code>est: html</code> for HTML content. Default
              is <code>text</code>. Do not specify a value
              unless <code>es</code> has been
              specified.
            </td>

          </tr>
          <tr class="">
            <td data-label="Feed Element" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e207 ">&nbsp;</td>

            <td data-label="Entry Element" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e210 ">
              <code>et</code>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e213 ">Required. Entry title, a field name. For example, <code>et:Name</code>. </td>

          </tr>
          <tr class="">
            <td data-label="Feed Element" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e207 ">&nbsp;</td>

            <td data-label="Entry Element" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e210 ">
              <code>eu</code>
            </td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d156799e213 ">
              <p>Optional. By default, the required ATOM element <code>&lt;updated&gt;</code> value is automatically
                provided by the <samp class="parmname">LastModifedDate</samp> of the main
                entity being queried; usually the object in the main <code>FROM</code> clause of the SOQL query. This
                value indicates the last time an entry or feed was modified. If you
                wish to change this default behavior, you can specify a different
                object or field's <samp class="parmname">LastModifedDate</samp> be used. For example:</p>
              <ul>
                <li>Query: <code>SELECT Id, Name, MyDate__c
                                            FROM Account</code>Mapping Parameter: <code>eu: MyDate__c</code></li>
                <li>Query: <code>SELECT Id, Lastname,
                                            Account.LastMOdifiedDate FROM Contact</code>Mapping
                  Parameter: <code>eu:
                                            Account.LastModifiedDate</code></li>
              </ul>
            </td>

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

The following example shows a valid mapping values for a syndication feed:

```
ft: "Harry Potter", et: Name, ec: "description for " Name "<br>" Description, el: "/" Id, ect: html
```

Feeds are displayed in the guest user context of the public site where they are displayed. Therefore, if you have used custom labels to manage internationalization, and specified labels in your mapping, users see those labels displayed in the language of the guest user.

You can only use string literals in feed mapping. You cannot use, for example, date literals such as `TODAY` or `LAST_WEEK`.

After you have defined a feed, you should test it, and then make the feed active by selecting the Active checkbox as described above. For more information about testing, see [Testing Syndication Feeds](https://help.salesforce.com/s/articleView?id=platform.feeds_bind_test.htm&release=264.0.0&type=5 "Before you enable a feed for customers, test the feed definition.").

## Using Bind Variables for Queries and Mapping

You can use bind variables in the `WHERE` clause of the SOQL query. Bind variables must be in the following form:

```
{!var_name}
```

The following query uses a bind variable named `accountID`.

```sql
SELECT Name, Description
FROM Account
WHERE Id = {!accountID}
```

Note that this is not the literal name of the field, but an arbitrary name. At run time, the value for `accountID` is passed to the query from the URL. This feed is accessed from the following URL and passes in the account ID as part of the query string parameter:

```
site_URL/services/xml/My'Account'Feed?accountId=0013000000BmP4x
```

You can also use bind variables for mapping values.

The following implementation details apply to the use of bind variables for queries:

- You cannot use more than 20 bind variables in a feed definition, queries and mapping combined.
- The bind variable name cannot be more than 100 characters.
- You can use a bind variable only on the right side of a filter operation to represent part of a string. Because it represents part of a string, it must be in quotes. For example, the following is a valid query:
    
    ```sql
    SELECT Id, Name FROM Account WHERE Name = '{!myBindVariable}'
    ```
    
    The following queries are not valid, because the bind variable is not in a valid position, and is not functioning as the variable for a literal string:
    
    ```sql
    SELECT Id, Name FROM Account WHERE {!myFieldName} = 'Joe'
    SELECT Id, {!myFieldName} FROM Account WHERE IsDeleted = false
    ```
- You cannot use a bind variable to represent a field name. This means a bind variable cannot be use on the left side of a filter operation.
- You cannot use a bind variable to change the meaning or structure of a query for security reasons. Any special characters you specify in the bind replacement value are interpreted as literal characters when the query is evaluated.

## Custom Labels and Feeds

For feeds that need to be localized into different languages, you can use custom labels to define the string in multiple languages. Then in the mapping definition, you simply refer to the custom label. When a request comes in, the custom label inspects the guest user language and returns the translated text, which is used in the mapping.

Custom labels can be specified in a field with the following syntax:

```
map_element_name: "{!$LABEL.custom_label_name}"
```

To specify a custom label in a feed, build the label via Custom Labels in Setup. For easy identification, you can name the custom label after the mapping element that takes its value, for example `feedTitle` for the `ft` element. Then specify the custom label in the feed mapping.

For example, assume that you create a feed containing information on all the houses your company is trying to sell. For English users, the title of the feed should be “The Houses,” but for Spanish users, the title of the feed should be “Las Casas.” You would create a custom label, for example, `feedTitle`. In English, its value is “The Houses,” and the Spanish value is “Las Casas.” Then, in the feed mapping definition, specify the following for the feed title `fc:`:

```
ft: "{!$LABEL.feedTitle}"
```

## Visualforce and Feeds

To add a feed to a Visualforce page, use the Visualforce standard HTML features. For example, assuming the Visualforce page is located in the base directory of the site, it can contain a tag like the following:

```html
<A HREF=""/services/xml/theFeedName">My feed</A>
```

The text `My feed` links to the feed.

If you want to link the feed from an image, include an inline image tag similar to the following:

```html
<A HREF="/services/xml/theFeedName"><img src="feed.gif"></A>
```

You must upload your own image.

To add the icon to the address bar, add the link tag to the `<head>` tag of the Visualforce page:

```markup
<link href='URI of feed'
   type='application/x.atom+xml'
   rel='feed'
   title='A nice descriptive title'/>
```

- **[About Syndication Feeds](https://help.salesforce.com/s/articleView?id=platform.feeds_overview.htm&release=264.0.0&type=5)**  
    Syndication feeds give users the ability to subscribe to changes within Salesforce Sites and receive updates in external news readers. Simply by defining a SOQL query and mapping, you can syndicate changes to public data to your end users. You can create one or more syndication feeds for your organization's public sites or any Visualforce page. The syndication feed displays the records specified by a SOQL query. Users can subscribe to the feed and view the feed when they visit the site or page.
- **[View Syndication Feeds](https://help.salesforce.com/s/articleView?id=platform.feeds_viewing.htm&release=264.0.0&type=5)**  
    View the syndication feed definition, including what records are returned, and which data from the records is displayed.
- **[Test Syndication Feeds](https://help.salesforce.com/s/articleView?id=platform.feeds_bind_test.htm&release=264.0.0&type=5)**  
    Before you enable a feed for customers, test the feed definition.