<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Service Portal: Custom Homepage Search Widget in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/service-portal-custom-homepage-search-widget/m-p/2654329#M1030066</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://www.servicenow.com/community/user/viewprofilepage/user-id/399799" target="_blank"&gt;@Alex Harrill&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Its nothing to do with widget / script. You need to define the search sources. You can refer below&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://docs.servicenow.com/bundle/rome-servicenow-platform/page/build/service-portal/task/add-table-search-source.html" target="_blank" rel="noopener noreferrer"&gt;https://docs.servicenow.com/bundle/rome-servicenow-platform/page/build/service-portal/task/add-table...&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please mark as Accepted Solution / Helpful if you get it&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 26 Aug 2023 17:56:10 GMT</pubDate>
    <dc:creator>Sohithanjan G</dc:creator>
    <dc:date>2023-08-26T17:56:10Z</dc:date>
    <item>
      <title>Service Portal: Custom Homepage Search Widget</title>
      <link>https://www.servicenow.com/community/developer-forum/service-portal-custom-homepage-search-widget/m-p/2652474#M1029486</link>
      <description>&lt;P&gt;I'm attempting to customize a copy of the Homepage Search widget. The original is currently on the homepage of our Service Portal. It searches the Catalog, Knowledge Base, and Users.&lt;BR /&gt;For the copy,&amp;nbsp;I want it on a different page as the company directory. So it would only show Users and exclude the Knowledge Base and Catalog search sources.&lt;BR /&gt;Below is the copied widget code I tried to modify:&lt;BR /&gt;&lt;BR /&gt;HTML:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;div id="homepage-search" class="hidden-l wrapper-l"&amp;gt;
  &amp;lt;div class="wrapper-l" style="padding: 5px;"&amp;gt;
    &amp;lt;h2 class="text-center text-4x m-b-lg sp-tagline-color" ng-bind="options.title"&amp;gt;&amp;lt;/h2&amp;gt;
    &amp;lt;div ng-if="options.short_description" class="text-center h4 m-b-lg sp-tagline-color" ng-bind="options.short_description"&amp;gt;&amp;lt;/div&amp;gt;
    
    &amp;lt;!-- Display only the "Users" search source --&amp;gt;
    &amp;lt;sp-widget widget="data.typeAheadSearch" source="'Users'" /&amp;gt;
  &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Server Script:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;var aisEnabled = $sp.isAISearchEnabled();

if (aisEnabled) {
  // Fetch the "Users" search source
  data.typeAheadSearch = $sp.getWidget('typeahead-search', options);
  data.typeAheadSearch.sources = data.typeAheadSearch.sources.filter(function(source) {
    return source.name === 'Users';
  });
} else {
  data.typeAheadSearch = $sp.getWidget('typeahead-search', options.typeahead_search);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This still displays all the search sources.&amp;nbsp;&lt;BR /&gt;I'm a bit of a novice when it comes to ServiceNow, so I'd love to hear any feedback on this! Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 14:43:54 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/service-portal-custom-homepage-search-widget/m-p/2652474#M1029486</guid>
      <dc:creator>Alex Harrill</dc:creator>
      <dc:date>2023-08-24T14:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: Service Portal: Custom Homepage Search Widget</title>
      <link>https://www.servicenow.com/community/developer-forum/service-portal-custom-homepage-search-widget/m-p/2654329#M1030066</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://www.servicenow.com/community/user/viewprofilepage/user-id/399799" target="_blank"&gt;@Alex Harrill&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Its nothing to do with widget / script. You need to define the search sources. You can refer below&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://docs.servicenow.com/bundle/rome-servicenow-platform/page/build/service-portal/task/add-table-search-source.html" target="_blank" rel="noopener noreferrer"&gt;https://docs.servicenow.com/bundle/rome-servicenow-platform/page/build/service-portal/task/add-table...&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please mark as Accepted Solution / Helpful if you get it&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Aug 2023 17:56:10 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/service-portal-custom-homepage-search-widget/m-p/2654329#M1030066</guid>
      <dc:creator>Sohithanjan G</dc:creator>
      <dc:date>2023-08-26T17:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: Service Portal: Custom Homepage Search Widget</title>
      <link>https://www.servicenow.com/community/developer-forum/service-portal-custom-homepage-search-widget/m-p/2659851#M1031861</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/121717"&gt;@Sohithanjan G&lt;/a&gt;,&lt;BR /&gt;I may have not been clear, so I apologize.&lt;BR /&gt;The Homepage Search widget is on our Service Portal homepage. I want to use the same widget on a different page of the same Service Portal. I've already defined the 3 search sources I've mentioned above.&lt;BR /&gt;But maybe I'm not understanding what you mean, if you don't mind elaborating &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2023 13:02:35 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/service-portal-custom-homepage-search-widget/m-p/2659851#M1031861</guid>
      <dc:creator>Alex Harrill</dc:creator>
      <dc:date>2023-09-01T13:02:35Z</dc:date>
    </item>
  </channel>
</rss>

