web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Pages
Unanswered

Search page

(0) ShareShare
ReportReport
Posted on by 103

Hi everyone

 

I'm trying to create a search page on my Power Pages site and am finding it a bit of a struggle.  Ideally I wanted to add a search box to my home page so users could search for records stored in a Dataverse table added to the site.  So far though I've only found that enabling search in the site settings displays a search icon on the top of every page in my site.

 

However, when I try clicking this icon I get the following error:

 

gjayne1984_0-1669632970812.png

Does anyone know what could be causing this?  I restarted the portal after enabling search in site settings but this hasn't helped.

 

Thanks in advance for your help.

Categories:
I have the same question (0)
  • oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    Can you check via Portal Management app if you have the Search Web Template? 

     

  • gjayn84 Profile Picture
    103 on at

    @OliverRodrigues thanks for the reply.  I've just checked and there's no Search web template showing up in the portal management:

     

    gjayne1984_0-1669670474022.png

    I'm just not sure how I go about adding it.  Apologies, but I've only just started using Portals/Power Pages so still getting to grips with it all

  • Verified answer
    mago_00 Profile Picture
    44 on at

    Hi,  I think the search template is included only on certain type of portal

     

    You can try creating the search template using the code below and see if it will work, this is the OOB search template that comes from customer service type portal

    {% assign search_enabled = settings['search/enabled'] | boolean | default:true %}
    {% assign search_page = sitemarkers['Search'] %}
    {% if search_enabled and search_page %}
    
    {% assign search_filters = settings['search/filters'] | search_filter_options %}
    
    <form method="GET" action="{{ search_page.url | h }}" role="search" class="form-search">
     <div class="input-group">
    
     {% if search_filters %}
     {% assign defaultSearchFilterText = snippets["Search/Default/FilterText"] | default: resx["All"] | h %}
     {% assign searchFilterLabel = snippets["Header/Search/FilterLabel"] | default: resx["Search_Filter"] | h %}
     {% assign formId = uniqueid.new_guid %}
     <div class="btn-group btn-select input-group-btn" data-target="#filter-{{ formId }}" data-focus="#{{search_id}}">
     <li class="dropdown-submenu dropdown">
     <button id="search-filter" type="button" class="btn btn-default"
     data-toggle="dropdown"
     aria-haspopup="true" aria-label="{{ searchFilterLabel }}" aria-expanded="false">
    
     <span class="selected">{{ defaultSearchFilterText }}</span>
     <span class="caret"></span>
     </button>
     <ul class="dropdown-menu" role="listbox" aria-label="{{ searchFilterLabel }}">
     <li role="presentation">
     <a href="#" role="option" data-value=""
     aria-label="{{ defaultSearchFilterText }}" aria-selected="false" tabIndex="-1">{{ defaultSearchFilterText }}</a>
     </li>
     {% for search_filter_option in search_filters %}
     <li role="presentation">
     <a href="#" role="option" data-value="{{ search_filter_option.value | h }}"
     aria-label="{{ search_filter_option.display_name | h }}" aria-selected="false" tabIndex="-1">{{ search_filter_option.display_name | h }}</a>
     </li>
     {% endfor %}
     </ul>
     </li>
     </div>
     <label for="filter-{{ formId }}" class="sr-only">{{ searchFilterLabel }}</label>
     <select id="filter-{{ formId }}" name="logicalNames" class="btn-select" aria-hidden="true" data-query="logicalNames">
     <option value="" selected="selected">{{ defaultSearchFilterText }}</option>
     {% for search_filter_option in search_filters %}
     <option value="{{ search_filter_option.value | h }}">{{ search_filter_option.display_name | h }}</option>
     {% endfor %}
     </select>
     {% endif %}
    
     <label for="{{search_id}}" class="sr-only">
     {{ snippets["Header/Search/Label"] | default: resx["Search_DefaultText"] | h }}
     </label>
     <input type="text" class="form-control" id="{{search_id}}" name="q"
     placeholder="{{ snippets["Header/Search/Label"] | default: resx["Search_DefaultText"] | h }}"
     value="{{ params.q | url_encode }}"
     title="{{ snippets["Header/Search/Label"] | default: resx["Search_DefaultText"] | h }}">
     <div class="input-group-btn">
     <button type="submit" class="btn btn-primary"
     title="{{ snippets["Header/Search/ToolTip"] | default: resx["Search_DefaultText"] | h }}"
     aria-label="{{ snippets["Header/Search/ToolTip"] | default: resx["Search_DefaultText"] | h }}">
     <span class="fa fa-search" aria-hidden="true"></span>
     </button>
     </div>
     </div>
    </form>
    {% endif %}

     

  • gjayn84 Profile Picture
    103 on at

    @mago_00 perfect thanks for that.  I've added that and the search now appears

  • mbhatt Profile Picture
    525 on at

    Hello Guys Need Help on search formula i want to use search function with this filters i am unable to add search formula showing error. (wrong column type expect text)

  • oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    hi @mbhatt I feel like your question is more Canvas Apps related, you can post your question on this forum: Building Power Apps - Power Platform Community (microsoft.com)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard