[Power Apps Portals]Enable Global Search for Custom Entity

Swati GoelDyn365CE4 years ago10 Views

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 Name Default Value
1. Search/Enabled True
 2. Search/EnableAdditionalEntities False
 3. Search/Filters Content: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/IndexNotesAttachments True
9. Search/RecordTypeFacetsEntities Blogs:adx_blog,adx_blogpost;Forums:adx_communityforum,adx_communityforumthread,adx_communityforumpost;Ideas:adx_ideaforum,adx_idea;Downloads:annotation,adx_webfile
10. KnowledgeManagement/DisplayNotes True

Content Snippets

S.No. Record’s Name Default Value
1. Header/Search/Label Search
 2. Header/Search/ToolTip Search
 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/ModifiedDate Modified date
9. Search/Facet/More Show more
10. Search/Facet/Product Products
11. Search/Facet/Rating Rating
12. Search/Facet/RecordType Record Type
13. Search/Facet/SortOrder/AverageUserRating Average User Ratings
14. Search/Facet/SortOrder/Relevance Relevance
15. Search/Facet/SortOrder/Views View 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.

Original Post https://derivingdynamics.home.blog/2020/06/03/power-apps-portalsenable-global-search-for-custom-entity/

0 Votes: 0 Upvotes, 0 Downvotes (0 Points)

Leave a reply

Join Us
  • X Network2.1K
  • LinkedIn3.8k
  • Bluesky0.5K
Support The Site
Events
March 2025
MTWTFSS
      1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31       
« Feb   Apr »
Follow
Sign In/Sign Up Sidebar Search
Popular Now
Loading

Signing-in 3 seconds...

Signing-up 3 seconds...