[Power Apps Portals]Enable Global Search for Custom Entity

Hello Dynamics Enthusiasts,

Hope you are safe while wfh and enjoying your family:)

I am writing this article to explain how to configure custom entity for Global Search in powers apps portal. Microsoft has released this feature in wave 1 2020 portal release. With this feature, user can search across multiple entities and configure what column of entities would be searchable.

Note: This is subjected to change as the limit of the custom entities which can be configurable for global search is 10.

There are a couple of predefined records in “Site Settings” and “Content Snippets” which run the search in the portal and those are listed below:

Site Settings

S.No.Record’s NameDefault Value
1.Search/EnabledTrue
 2.Search/EnableAdditionalEntitiesFalse
 3.Search/FiltersContent:adx_webpage; Events:adx_event,adx_eventschedule; Blogs:adx_blog,adx_blogpost,adx_blogpostcomment;
Forums:adx_communityforum,adx_communityforumthread,
adx_communityforumpost;Ideas:adx_ideaforum,adx_idea,
adx_ideacomment; Issues:adx_issueforum
 4. Search/IndexQueryName Portal Search
 5. Search/Query +(@Query) _title:(@Query) _logicalname:adx_webpage~0.9^0.2 -_logicalname:adx_webfile~0.9 adx_partialurl:(@Query) _logicalname:adx_blogpost~0.9^0.1 -_logicalname:adx_communityforumthread~0.9
 6. Search/Stemmer English
 7. Search/FacetedView True
8.Search/IndexNotesAttachmentsTrue
9.Search/RecordTypeFacetsEntitiesBlogs:adx_blog,adx_blogpost;Forums:adx_communityforum,adx_communityforumthread,adx_communityforumpost;Ideas:adx_ideaforum,adx_idea;Downloads:annotation,adx_webfile
10.KnowledgeManagement/DisplayNotesTrue

Content Snippets

S.No.Record’s NameDefault Value
1.Header/Search/LabelSearch
 2.Header/Search/ToolTipSearch
 3.Search/Default/FilterText All
 4. Search/Facet/All All
 5. Search/Facet/ClearConstraints Clear All
 6. Search/Facet/Downloads Downloads
 7. Search/Facet/Less Show less
8.Search/Facet/ModifiedDateModified date
9.Search/Facet/MoreShow more
10.Search/Facet/ProductProducts
11.Search/Facet/RatingRating
12.Search/Facet/RecordTypeRecord Type
13.Search/Facet/SortOrder/AverageUserRatingAverage User Ratings
14.Search/Facet/SortOrder/Relevance
Relevance
15.Search/Facet/SortOrder/ViewsView Count

Before start to configure the custom entity for search. Please make sure that all the records of “Site Settings” and “Content Snippets” are the same as mentioned above, some of the values(Header/Search/Label, Header/Search/ToolTip) may be different based on your requirement.

Let’s get going and follow the steps as below:

Step 1: Add Search/EnableAdditionalEntities of True value in site setting.

Step 2: create/update the search/filters setting, and add the value Restaurants:new_restaurant.

Step 3: create a “Portal Search” view to the corresponding entity for which you are configuring the global search and all the added column to view will be searchable in the search.

Tip*: “Portal Search” is the default view name in Search/Index/QueryName entry of site setting, If in case you want to change the view name other than Portal Search then please don’t forget to update the new view name in Search/Index/QueryName entry of site setting and you need to maintain the same view name across the entities for which you want to configure search. 🙂

Step 4: Create/Update Entity Permission and associate web role(authenticated user) to it .

a)Entity Permission: Create/Update Entity Permission to the respective entity and you can set any scope as per your need, I have taken Global. Preferably, privileges should be Read only.

b) Go to the Related and assign Web role to it. Web role can be any of your choice if you want to show the result to anonymous user then assign anonymous role. Perhaps, it is not recommended due to data security concerns.

Step:5 Create search result web page to show your detailed information of entity record.

a) By attaching the Entity form. You can create your own web template as well and there don’t forget to pass the record id (I was completely new when I was configuring this and haven’t had idea how to pass the record id so just to make it ease for you :)). Here is the code

{% if page.adx_entityform %}
{% entityform id: page.adx_entityform.id %}
{% endif %}

for the demonstration purpose, I used “Default Studio Template”

Screen from Portal Studio
screen from model driven app

Step 6: Create a Site Maker record where you need to browse the search result page and name it as “entitylogicalname_SearchResultPage”

Now the time has come to “Clear cache” and “Rebuilt search index”

Therefore, I had covered all the steps to configure custom entity for Global search.In case you require any further assistance, can reach out to me on LinkedIn.

Oops,I forgot to show you the result. I typed RES and it showed me three records.

Now, clicked any of them and it will show the Search Result Page.

Hope it helps.

May be the dynamics power with you.

One thought on “[Power Apps Portals]Enable Global Search for Custom Entity

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s