I've added "Files" as an autocomplete object to my Global Search for Peer-to-Peer Communities component in my Customer Service community. However, no results ever seem to appear. I have verified with different users that they do have Files they can see and can find them by actually running the search, but no autocomplete suggestions appear.

I've also verified that the Files object has a search result layout in my org. Is there anything additional I need to do to get these to appear? I removed all of the other autocompletion objects from the component to ensure none of them could be impacting results and still get no suggestions.

Component Configuration

1 Answer 1


I figured this out. A File will show up in the Global Search Results if it's shared with the user but it will only appear in the autocomplete suggestions if the NetworkId (the Community the ContentVersion is associated with) is the same as the user's community or the community you're actively searching in.

I've verified this by uploading a file as a different user in the same community and then sharing that file with another user. The file shows up in the autocomplete suggestions because even though the Owner is someone else, it's shared with the searching user and the NetworkId field is the same.

Uploading a file via the Files tab in Salesforce will not allow the file to be shown in autocomplete results because the NetworkId will be null. However, you can still upload a file in Salesforce and share it to with a Community user so that the file appears in Global Search Results. This bullet from the Search Behavior in Communities article clued me in to the behavior (emphasis mine):

With global search from your internal org, you can get uneven results when searching for a community User record. Here’s why and what you can do about it. Each community has a unique network ID. When you create a community user through Contact record | Create External User, the new User record is assigned to a community's network ID. Global search looks for records in the internal org, which has a different network ID than the community. A global search doesn't search inside communities. Since the User record is associated with a community network ID, global search doesn't return results for that record.

The workaround is to create User records in the internal org, and then associate the records to a community. You can associate an internal User record to a community by linking the internal record to a Contact record. After you forge the link, you can find the User record through global search. The User record's network ID is now associated with the internal org.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .