---
schema_version: "1"
id: af953d7d746b0c9ad0fc8d16a8402cbeba7564b07fdbb9be84ca577c593450e7
title: ContentHubItem
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/object_reference/sforce_api_objects_contenthubitem.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_contenthubitem.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 918d3004f2917a88b35c8b753bb83329b93476953888f231fbfab2a79ba2156b
description: Represents a file or folder in a Files Connect external data source, such as Microsoft SharePoint or OneDrive for Business. This object is available in API version 33.0 and later.
---
# ContentHubItem

Represents a file or folder in a Files Connect external data source, such as Microsoft SharePoint or OneDrive for Business. This object is available in API version 33.0 and later.

## Special Access Rules

Chatter and Files Connect must be enabled for the organization.

## Supported Calls

describeSObjects(), query(), search()

## Fields

| Field Name | Details |
| --- | --- |
| ContentHubRepositoryId | 
Type

reference

Properties

Filter, Group, Nillable

Description

The ID for the related external data source described by the [ContentHubRepository](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_contenthubrepository.htm "Represents a Files Connect external data source such as Microsoft SharePoint or OneDrive for Business. This object is available in API version 33.0 and later.") object.



 |
| ContentItemSize | 

Type

long

Properties

Group, Nillable

Description

The size of the file or folder. Available in API version 65.0 and later.



 |
| ContentModifiedDate | 

Type

dateTime

Properties

Nillable

Description

Date the file or folder content last changed.



 |
| ContentSize | 

Type

int

Properties

Group, Nillable

Description

The size of the file or folder that's less than 2 GB.



 |
| Description | 

Type

string

Properties

Filter, Group, Nillable

Description

Explanation of item in external data source.



 |
| ExternalContentUrl | 

Type

url

Properties

Group, Nillable

Description

The URL of the document content in the external data source.



 |
| ExternalDocumentUrl | 

Type

url

Properties

Group, Nillable

Description

The URL of the detail page in the external data source.



 |
| ExternalId | 

Type

string

Properties

Filter, Group, Nillable, Sort

Description

ID for the file or folder in the external data source.



 |
| FileExtension | 

Type

string

Properties

Group, Nillable

Description

File format extension, such as .doc or .pdf



 |
| FileType | 

Type

string

Properties

Group, Nillable

Description

Complete file type, such as “Microsoft Word Document.”



 |
| IsFolder | 

Type

boolean

Properties

Defaulted on create, Filter, Group, Sort

Description

Indicates whether item is a folder or file.



 |
| MimeType | 

Type

string

Properties

Filter, Group, Nillable

Description

MIME type of the content.



 |
| Name | 

Type

string

Properties

Filter, Nillable, Sort

Description

Name of the file or folder in the external data source.



 |
| Owner | 

Type

string

Properties

Filter, Group, Nillable

Description

Username of the content owner in the external data source.



 |
| ParentId | 

Type

string

Properties

Filter, Group, Nillable

Description

The ID of the parent folder for the record.

This field isn’t returned in queries or searches of the ContentHubItem object. It supports only WHERE clauses, such as the following:

WHERE ContentHubRepositoryId = <ID of external source> and ParentId = <ID of parent folder or record>.

Or specify WHERE ParentId = <name of root folder> to return the children of the root folder.

![Tip](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/images/icon_note_tip.png)

#### Tip

The ParentId field supports both Salesforce IDs (in the format “0CHxxx”) and external IDs.















 |
| Title | 

Type

string

Properties

Group, Nillable

Description

The title that appears in the content, which often differs from the Name of the containing file or folder.



 |
| UpdatedBy | 

Type

string

Properties

Group, Nillable

Description

Username for the person who last updated the file.



 |

## Usage

The following SOQL query examples show how to retrieve files and folders from a Files Connect external data source. These examples use placeholders for ID values for the repository ID and folder IDs. Before running these queries, replace the placeholders with valid ID values for your external data source and folders.

![Important](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/images/icon_note_important.png)

#### Important

You must filter queries and searches on ContentHubItem with the ContentHubRepositoryId field; for example, SELECT Id FROM ContentHubItem WHERE ContentHubRepositoryId = <ID of external data source>.

**Example 1:** Get the ID and name of the root folder in an external file source.

SELECT Id, Name
FROM ContentHubItem
WHERE ContentHubRepositoryId = '<repository ID>' AND ParentId = NULL

**Example 2:** List all folders and files under the specified root folder.

SELECT Id, Name
FROM ContentHubItem 
WHERE ContentHubRepositoryId = '<repository ID>' AND ParentId = '<root folder ID>'

**Example 3:** List all external file data sources by querying ContentHubRepository.

SELECT DeveloperName 
FROM ContentHubRepository

**Example 4:** List all files and folders in a given folder and external file source.

SELECT Id, Name 
FROM ContentHubItem 
WHERE ContentHubRepositoryId = '<repository ID>' AND ParentId = '<parent folder ID>'

**Example 5:** To return only folders in the result set, add IsFolder = true in the WHERE clause to a query that returns files and folders. For example, the following query lists all folders under the root folder.

SELECT Id, Name 
FROM ContentHubItem 
WHERE ContentHubRepositoryId = '<repository ID>' AND ParentId = '<root folder ID>'
      AND IsFolder = true

**Example 6:** Retrieve a link that is used to open the specified document in an external source.

SELECT ExternalDocumentUrl 
FROM ContentHubItem 
WHERE ContentHubRepositoryId = '<repository ID>' AND Id = '<document ID>'

**SOSL Example:** Retrieve the ID and name of all documents that contain the search string. The result set is limited to the first 10 documents.

FIND {<search string>} 
RETURNING ContentHubItem(Id, Name 
                         WHERE ContentHubRepositoryId = '<repository ID>') 
LIMIT 10