---
category: [Administration & Integrations, Platform and Product Extensions, Platform and Product Extensions/Integration, Administration & Integrations/Custom Integrations & Apps, Platform and Product Extensions/Workday Extend]
keyword: [Extend, Presentation Components, widgets, tags, UI components]
nav: wcp_docs
parent_url: /wcp_docs/
title: facetedSearch
layout: subsection
wd_wcptag: facetedSearch
---

<a id="section_N10021_N1001E_N10001"></a>
A container widget that displays search results with facets. Users can select the facets to filter the results.

Use `facetedSearch` only on view pages.

A `facetedSearch` widget contains composite tags, which you specify under these main attributes:

-   <b>facetList</b>

    Specifies the [facetList](/wcp_docs/are1518472620612.html), which contains a template facet definition for the search facets.

    The `facetDefinition` uses the [facet](/wcp_docs/gnc1519333008615.html) tag, which contains a facet value definition for the selectable facet values. A `facetValueDefinition` uses the [facetValue](/wcp_docs/moi1519336254812.html) tag.

-   <b>results</b>

    Specifies the [facetedSearchResult](/wcp_docs/qxy1519331905298.html), which contains a template for the search result items.

    The `template` uses the [templatedListItem](/wcp_docs/wvo1524110564754.html), which displays a title link and a subtitle with concatenated summary information.



This diagram illustrates the `facetedSearch` and its composite tags. This example uses a sample custom report, <i>My_Job_Postings</i>, which searches the Job Posting Anchor data source.

![](GUID-80f4bfaa-8a40-4a71-bcf6-9c5c55a4c75e-enHYPHENus.png)

To use a custom report with the `facetedSearch` widget:

-   Enable the custom report as a Reports-as-a-Service (RaaS). On the custom report definition, configure these settings:

<table><thead><tr><th>Option</th><th>Description</th></tr></thead><tbody><tr><td><b>Report Type</b></td><td>Select <b>Search</b>.</td></tr><tr><td><b>Enable as Web Service</b></td><td>Select the checkbox.</td></tr><tr><td><b>Search Results</b></td><td>Add the fields to display in the search results list. Include the Workday ID field, which you can use when linking to a detail page. To avoid displaying the Workday ID from the default search result list, set the <b>Options</b> to <b>Detail Result Field</b>.</td></tr><tr><td><b>Facet Options</b> on the <b>Advanced</b> tab</td><td>Add the fields that represent the search facets.</td></tr></tbody></table><br/>

-   In the PMD, specify the Reports-as-a-Service (RaaS) URL as an inbound endpoint.

    A RaaS endpoint uses the format: `https://api.workday.com/raas/{user}/{report_name}?format=json`.

    Set the `search` attribute of the RaaS endpoint to true.

    Example:

    ```
    "endPoints": [
       {
         "name": "facetedSearchData",
         "baseUrlType": "workday-raas",
         "url": "/lmcneil/My_Job_Postings?format=json",
         "authType": "sso",
         "search": "true"
       }
    ]
    ```

    The `dataProviders` definition in the AMD:

    ```
    {
         "key": "workday-raas",
         "value": "https://api.workday.com/raas"
       }
    ```



## <a id="section_gcr_h22_mhb"></a>Example

This `facetedSearch` displays the faceted search results from a sample <i>My Job Postings</i> custom report:

```
"presentation": {
   "body": {
     "type": "section",
     "horizontal": false,
     "sorted": false,
     "children": [
       {
         "type": "facetedSearch",
         "facetList": {
           "type": "facetList",
           "paginationCount": "<% facetedSearchData.ResultCountEntry[0].ResultCount ?? 0 %>",
           "facets": "<% facetedSearchData.FacetEntry %>",
           "facetVariableName": "facet",
           "minFacetValuesForSearchPrompt": 10,
           "facetDefinition": {
             "type": "facet",
             "facetValueVariableName": "facetValue",
             "facetValues": "<% facet.FacetValue %>",
             "label": "<% facet.Facet_Reference %>",
             "facetId": "<% facet.FacetParameter %>",
             "facetValueDefinition": {
               "type": "facetValue",
               "value": "<% facetValue['FacetInstance_Reference_-_WID'] %>",
               "count": "<% facetValue.Count %>",
               "selected": "<% facetValue.Select %>",
               "label": "<% facetValue.FacetInstance_Reference %>"
             }
           }
         },
         "results": {
           "resultValues": "<% facetedSearchData.Report_Entry %>",
           "resultValueVariableName": "result",
           "template": {
             "type": "templatedListItem",
             "title": {
               "type": "instanceList",
               "instanceList": [
                 {
                   "action": "GET",
                   "descriptor": "<% result.title %>",
                   "type": "instance",
                   "view": "true"
                 }
               ],
               "taskReference" : {
                 "parameterBindings" : {
                   "jobPostingId" : "<% result.workdayID %>",
                   "title" : "<% result.title %>"
                 },
                 "taskId" : "jobDetails"
               }
             },
             "subtitles": [
                   "<% result.postedOn %>",
                   "<% result.jobRequisitionId %>",
                   "<% result.locationsText %>"
             ]
           }
         }
       }
     ]
   }
 }
```

The custom report definition of <i>My Job Postings</i> contains these <b>Search Results</b> fields. The `results` attribute in the sample `facetedSearch` uses the field aliases to display the title and subtitles in the search results list.

<table><thead><tr><th>Field</th><th>Field Alias</th></tr></thead><tbody><tr><td>Job Posting</td><td>jobPosting</td></tr><tr><td>Job Requisition ID</td><td>jobRequisitionId</td></tr><tr><td>Job Posting Title</td><td>title</td></tr><tr><td>Locations as Text</td><td>locationsText</td></tr><tr><td>Posted Date as Text</td><td>postedOn</td></tr><tr><td>Workday ID</td><td>workdayID</td></tr></tbody></table><br/>

The <i>My Job Postings</i> custom report also contains these <b>Facet Options</b> fields:

<table><thead><tr><th>Field</th><th>Field Alias</th></tr></thead><tbody><tr><td>Job Category</td><td>jobFamilyGroup</td></tr><tr><td>Locations</td><td>locations</td></tr><tr><td>Job Type</td><td>workerSubType</td></tr><tr><td>Full/Part-time</td><td>timeType</td></tr></tbody></table><br/>

To determine how to specify the `facetList`, `facetDefinition` , and `facetValueDefinition` attributes, inspect the JSON of the report. Determine the JSON fields that map to these required attributes:

-   <b>facetList: paginationCount</b>

    The total number of search result items. Example: <i>facetedSearchData.ResultCountEntry[0].ResultCount</i> where <i>facetedSearchData</i> is the endpoint name.

-   <b>facetList: facets</b>

    The list that contains the facet groups. Example: <i>facetedSearchData.FacetEntry</i>.

-   <b>facetList: facetVariableName</b>

    Any string that represents a facet group.

-   <b>facetDefinition: facetValues</b>

    The facet group list that contains the facet values. Example: <i>facet.FacetValue</i> where <i>facet</i> is the `facetVariableName`.

-   <b>facetDefinition: label</b>

    The display name of the facet group. Example: <i>facet.Facet_Reference</i>.

-   <b>facetDefinition: facetId</b>

    The ID of the facet group. Example: <i>facet.FacetParameter</i>.

-   <b>facetDefinition: facetValueVariableName</b>

    Any string that represents a facet value.

-   <b>facetValueDefinition: value</b>

    The facet value. Example: <i>facetValue['FacetInstance_Reference_-_WID']</i> where <i>facetValue</i> is the `facetValueVariableName`.

    <b>Note:</b> We use the bracket notation with the quoted field name instead of the dot notation, <i>facetValue.FacetInstance_Reference_-_WID</i>. The hyphen in the the dot notation causes an error because PMD Scripting interprets the hyphen as a subtraction operator.

-   <b>facetValueDefinition: count</b>

    The number of search result items for the facet value instance. Example: <i>facetValue.Count</i>.

-   <b>facetValueDefinition: label</b>

    The display name of the facet value. Example: <i>facetValue.FacetInstance_Reference</i>.



JSON snippet from the sample custom report:

```
{
   "ResultCountEntry": [
       {
           "ResultCount": "233"
       }
   ],
   "FacetEntry": [
       {
           "FacetParameter": "timeType",
           "FacetValue": [
               {
                   "FacetInstance_Reference_-_WID": "900fa8d9ae6f45a0a788545a85878f40",
                   "FacetInstance_Reference": "Full time",
                   "Select": "0",
                   "Count": "227"
               },
               {
                   "FacetInstance_Reference_-_WID": "ffe587973a074bee89fb9276ef9b22a8",
                   "FacetInstance_Reference": "Part time",
                   "Select": "0",
                   "Count": "6"
               }
           ],
           "Facet_Reference": "Full/Part-time"
       },
       {
           "FacetParameter": "jobFamilyGroup",
           "FacetValue": [
               {
                   "FacetInstance_Reference_-_WID": "29fe37cf54b74c388049f2c74ce430cd",
                   "FacetInstance_Reference": "Customer Services",
                   "Select": "0",
                   "Count": "102"
               },
               . . .
           ],
           "Facet_Reference": "Job Category"
       },
       {
           "FacetParameter": "workerSubType",
           "FacetValue": [
               {
                   "FacetInstance_Reference_-_WID": "9459f5e6f1084433b767c7901ec04416",
                   "FacetInstance_Reference": "Regular",
                   "Select": "0",
                   "Count": "218"
               },
               . . .
           ],
           "Facet_Reference": "Job Type"
       },
       {
           "FacetParameter": "locations",
           "FacetValue": [
               {
                   "FacetInstance_Reference_-_WID": "d13a7c46a06443c4a33c09afbdf72c73",
                   "FacetInstance_Reference": "San Francisco",
                   "Select": "0",
                   "Count": "72"
               },
               . . .

           ],
           "Facet_Reference": "Locations"
       }
   ],
   "Report_Entry": [
       {
           "postedOn": "Posted 30+ Days Ago",
           "workdayID": "6d96eef1166f10d7281aeff4ee9c1429",
           "jobPosting": "HR Manager-EMEA",
           "jobRequisitionId": "R-00044",
           "title": "HR Manager-EMEA",
           "locationsText": "London"
       },
       . . .
   ]
}
```

## <a id="section-mobile-support"></a>Mobile Support

Android, iOS

## <a id="section_qpw_1kc_ccb"></a>Attributes

-   <b>facetList</b>

    Data type: facetList

    (Required) The `facetList` tag, which specifies the facet groups and the template facet definition. See [facetList](/wcp_docs/are1518472620612.html).

-   <b>id</b>

    Data type: binding-String

    Unique identifier used to reference this widget from other tags.

    Notes:

    -   The `id` must start with a letter.
    -   The `id` must be unique per page.
    -   To enable other widgets to reference this widget `id`, place this widget before the other widgets on the PMD. The PMD validation returns an "Undefined variable" error if it doesn't find a previously defined `id` in the PMD.
    -   Workday recommends that you include the `id` in your tag definitions for debugging purposes.

-   <b>render</b>

    Data type: binding-Boolean

    If true, this tag renders as a widget on the page. If false, the loaded page doesn't add this tag or its children. The default is true.

    Unlike the `visible` attribute, when `render` is false, other tags on the page can't reference this tag or widget on edit pages. On view pages, a tag can't reference other tags regardless of the `render` attribute value.

-   <b>results</b>

    Data type: facetedSearchResult

    (Required) The `facetedSearchResult` tag, which specifies the search results data and the template for displaying each search result item. See [facetedSearchResult](/wcp_docs/qxy1519331905298.html).

-   <b>sortOrder</b>

    Data type: binding-String

    When you set `sorted` to true on the `section` or `fieldSet` parent of this widget, the `sortOrder` attribute determines the order of this widget within its parent. The sort order is relative to the siblings of the widget.

    Typical values are "a", "b", "c", and so on. Example: The widget with `"sortOrder": "a"` displays before the widget with `"sortOrder": "b"`.

    <b>Note:</b> The `sortOrder` doesn't apply to sorting data on the widget. `sortOrder` only applies to the placement order of the widgets within the parent widget.

-   <b>useCustomReport</b>

    Data type: boolean

    If true, the facetSearch widget can use custom reports to generate results instead of hard-coded reports.



