---
schema_version: "1"
id: 5bacc605d077bbc7adba164747ed87c6455362dd8367904bd33bc942f7a421e8
title: Include SharePoint Custom Properties in Search, SOQL, and SOSL Queries
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/experience/264-0-0/admin_files_connect_sp_custom_props.md
canonical_url: https://help.salesforce.com/s/articleView?id=experience.admin_files_connect_sp_custom_props.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 41e7be7305248b4a1145509d4e75e92fdc2445b6bd6c105906209e25280f4cf3
description: After you create an external object for a SharePoint data source, some special steps are needed to search or query any custom properties it contains.
products:
  - Experiences
release: "264"
---
# Include SharePoint Custom Properties in Search, SOQL, and SOSL Queries

After you create an external object for a SharePoint data source, some special steps are needed to search or query any custom properties it contains.

### 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;">Files Connect for cloud-based external data sources is available in: <strong>Professional</strong>, <strong>Enterprise</strong>, <strong>Performance</strong>, <strong>Unlimited</strong>, and <strong>Developer</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="d19436e71">User Permissions
            Needed</th>
        </tr>
      </thead>
      <tbody>
        <tr class="">
          <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d19436e71 ">To create an external object and provide access to its fields:</td>

          <td class="slds-cell-wrap" style="vertical-align:top;" headers="d19436e71 ">Customize Application</td>

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

## Configuring Custom Properties in SharePoint

If you have the existing mapped custom columns and Office documents' (Microsoft Word, Excel, etc.) metadata in SharePoint, external objects in Salesforce let you select and filter on the following custom properties:

- Custom columns defined in a Custom Content Type
- Metadata from Microsoft Word, Excel, and other Office documents

To search on these custom properties in Salesforce, a Sharepoint administrator must create a corresponding Managed Property.

- To display these properties in external object fields, or use them in SOQL or SOSL `SELECT` queries, set the corresponding Managed Property to Retrievable.
- To filter on these properties in external objects, or use them as query criteria in a SOQL or SOSL `WHERE` clause, set the corresponding Managed Property to Queryable.

## Querying Resulting Fields in Salesforce for SharePoint Online

In the following example, `CustomProperty` stands for the Custom column name defined in the Custom Content Type, or the Office document metadata name. `ManagedCustomProperty` stands for the corresponding Managed Property name.

In most cases, you can use `ManagedCustomProperty` for both the `SELECT` and `WHERE` clause. Here’s a SOQL example:

```sql
SELECT ManagedCustomProperty FROM items_spOnline_x WHERE ManagedCustomProperty=...
```

However, for file types that SharePoint doesn’t index for search, such as .jpg, .png, and .pdf files, you must use `CustomProperty` in the `SELECT` clause and `ManagedCustomProperty` in the `WHERE` clause. As a workaround, you can define an alias on the Managed Property in SharePoint and format queries like this:

```sql
SELECT Alias FROM items_spOnline WHERE Alias=...
```

Normally, custom properties aren’t displayed on external object detail pages—defining an alias also addresses this issue.

## Boolean Custom Properties

When using boolean (Yes/No) custom properties with a corresponding Managed Property set to the Text type, the corresponding external object field must be set to the Text type as well. In filters, the values “0” and ”1” equal false and true, respectively. For example:

```sql
WHERE customBooleanWithTextManagedProperty=”1”
```

“0” and ”1” are also displayed as results, however, so boolean custom properties should use a Managed Property type of YesNo. Set the corresponding external object field to Checkbox to query it with standard `true` or `false` values. For example:

```sql
WHERE customBooleanWithYesNoManagedProperty=true
```

## Metadata in Microsoft Office Documents

The Sharepoint Search service returns all metadata from Office documents as strings, so corresponding external object fields must be set to the Text type.

Dates are returned in the format, MM/DD/YYYY hh:mm:ss AM/PM, (for example, “3/31/2015 9:59:00 PM”). To query on fields using the Date type, the external object must include a corresponding Date field for filtering, and a Text field for selecting.

## Limitations for Specific SharePoint Property Types in Salesforce for SharePoint Online

- Number, Currency, and Choice multiple properties can’t be selected for file types SharePoint doesn’t index for search. By default, this includes image, video, and .pdf files, although .pdf files are natively indexed starting with SharePoint 2013.
- Multiple Line of Text, URL, and Date properties aren’t queryable.
- Choice multiple and URL properties can’t be selected.

#### See Also

- [Include a Files Connect Data Source in Global Search](https://help.salesforce.com/s/articleView?id=experience.admin_files_connect_search.htm&release=264.0.0&type=5 "Combine searches for Salesforce data with external data from Google Drive, SharePoint, OneDrive for Business, or Box. Developers can automate the process with supported SOQL or SOSL queries with the API.")