Walkthrough: Configuring additional entities for global search
You can enable additional entities for search functionality. Configuring search for additional entities requires additional actions, which are described in this article. These explicit configuration steps ensure that no records will accidentally be made available using global search.
Steps to configure search for additional entities
To configure search for additional entities:
Enable additional entities search for the first time by adding a new setting Search/EnableAdditionalEntities and set it to true. This is a one-time step that enables search for all additional out-of-the-box and custom entities.
Create Portal Search view for each additional entity with the required filters and columns that needs to be searchable.
Configure entity permissions for each additional entity with a Web Role to have at least read privilege. Skip this step if you already have the read permissions configured for each entity.
Create a record details page for each entity to show the details of the selected record from the search results page. Skip this step if you already have created separate results record details page for each entity.
If you don't create a record details page, or if you don't bind the record details page with site marker for search, you won't be able to select the additional entity records from search results page to view the record details.
Site setting for additional entities
The site setting Search/EnableAdditionalEntities is required when configuring additional entities for search.
Search/EnableAdditionalEntities is explicitly for enabling search for additional entities. The main search site setting Search/Enabled must be set to true when using search functionality.
You can also configure other related site settings similar to the search configuration for default entities. For example, you can use the Search/Filters setting to configure additional entities and add a drop-down filter option to the global search. More information: Site setting.
Site marker for record details page
The record details page is configured using a Site Marker named
For example, if your entity logical name is nwind_products, the site marker will be
nwind_products_SearchResultPage. The value of the site marker is the record details page that you want to open when that search result is selected. By default, a record ID is passed in the id querystring parameter to the record details page. For more information about adding forms on a page, go to Compose a page.
Ensure that your record details page has an entity form, or has logic written to show the search result details. For example, Step 4 - Add record details page in the following walkthrough.
The following walkthrough explains each step in detail with a sample database and solution to configure search for additional entities.
- This walkthrough explains how to enable search for the Order Products entity in the sample database Northwind, available with Common Data Service. For more information about sample databases, see Install Northwind Traders database and apps.
- You can follow the walkthrough with an entity of your choice by replacing the nwind_products entity name with your entity's logical name.
Step 1: Add or update search site settings
Sign in to Power Apps.
Ensure that you're in the appropriate environment where your portal exists.
Select Apps in the left navigation pane, and locate the Portal Management model-driven app.
The Portal Management app might be named Dynamics 365 Portals if you're in an environment where Dynamics 365 applications are installed.
Select to open the Portal Management app, and then go to Site Settings in the left navigation pane.
Create a new setting, Search/EnableAdditionalEntities, and set its value to true.
Create or update the search/filters setting, and add the value Products:nwind_products.
Step 2: Create or verify the Portal Search view
The following steps require the Northwind Traders solution to be installed. If you want to use another entity, use the appropriate solution or use the Default solution.
Go to Power Apps, and select Solutions from the left navigation pane.
Select Northwind Traders.
Search for the Order Product entity.
Select the Order Product entity, and then select Views.
Ensure that you see Portal Search in the views list.
If the Portal Search view doesn't already exist, select Add view, enter the name as Portal Search, and then select Create.
Ensure appropriate columns are added to the view for search.
If you edited the view, be sure to select Save, and then Publish before you continue.
Step 3: Create entity permissions
Sign in to Power Apps.
Select Apps in the left navigation pane, and then select to open the Portal Management model-driven app.
Select Entity Permissions in the left navigation pane.
Enter the name as Northwind Products Read All, and then select the appropriate Scope and the Read privilege.
For this example, the Global scope is provided to the nwind_products entity.
Select Save & Close.
Select and open Northwind Products Read All.
Scroll down to the Web Roles section, and then select Add Existing Web Role.
Search for Authenticated Users, and then select Add:
Step 4: Add record details webpage
Go to Power Apps, and select Apps in the left navigation pane.
Select More Commands (…) for the portal, and then select Edit to open the portal in Power Apps Studio.
Select New Page from the menu in the upper-left corner, and then select the Blank layout for the page.
Enter the webpage name as Order Products.
This page will be shown when users select a record from the search results page to view the details of the selected record.
Select Components in the left navigation pane, and then add a Form component to this webpage.
Select the Use existing option on the right side of your workspace, choose the View Products form for the nwind_products entity, and then set Mode to ReadOnly.
Step 5: Add a site marker for record details webpage
Sign in to Power Apps.
Select Apps in the left navigation pane, and select to open the Portal Management model-driven app.
Select Site Marker from the left navigation pane.
Select New, and then create a new site marker by using the following details:
- Name: nwind_products_SearchResultPage
- Page: Order Products
Step 6: Rebuild the search index
Browse your portal by using a user account that has the Administrator web role assigned.
Append the URL in the address bar with /_services/about, and then select Enter.
Select Clear cache.
After clearing the cache, select Rebuild search index.
Step 7: Verify that global search works with the custom entity
Browse to the portal with a user that has Authenticated Web Role assigned.
Go to the search toolbar or the search page, and search for a known record.
For example, use the search keyword Northwind Clam Chowder to get the results associated with the nwind_products entity.