---
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: monikerLevel
layout: subsection
wd_wcptag: monikerLevel
---

<a id="section_N10021_N1001E_N10001"></a>
Represents a sublevel within a multilevel `instanceList`. The parent `instanceList` tag defines the root level, and its `monikerLevels` attribute defines the sublevels. The values that the user selects from the last level (leaf nodes) display as the selected values on the `instanceList`.

`dynamicMonikerLevels` and `monikerLevels` are mutually exclusive. Use `monikerLevel` only on edit pages.

## <a id="section_kgk_fh1_n3b"></a>Usage

## <a id="section_ajy_xy5_crb"></a>Adding a Sublevel to an instanceList

To add a sublevel to an `instanceList`:

1.  Add a `monikerLevel` to the `monikerLevels[]` attribute of the `instanceList`.
2.  Specify these `monikerLevel` attributes:

    -   `levelValues` - The data collection from a deferred endpoint or a list of values containing the `id` and `descriptor` fields.
    -   `endPoint` - The deferred endpoint that returns the data specified in `levelValues`. If the `levelValues` attribute doesn't use an endpoint, you can omit `endPoint`.



<b>Note:</b> If the multilevel list has more than 2 sublevels, ensure that the order of the `monikerLevel` tags corresponds to the order of the sublevel that they represent.

This sample `instanceList` has 3 levels: supervisory organizations, org charts, and subordinate organizations. In this example, the leaf nodes are the subordinate organizations. When the user selects subordinate organizations, they display as the selected values on the `instanceList`.

```
{
 "type": "instanceList",
 "label": "Select subordinate orgs",
 "multiSelect": "true",
 "id": "organizationSubordinatesList",
 "values": "<% supervisoryOrganizations.data %>",
 "monikerLevels": [
   {
     "type": "monikerLevel",
     "levelValues": "<% orgChart.data %>",
     "endPoint": "<% endpoints.orgChart %>"
   },
   {
     "type": "monikerLevel",
     "levelValues": "<% orgChartSingleton.subordinates %>",
     "endPoint": "<% endpoints.orgChartSingleton %>"
   }
 ]
}
```

## <a id="section_lkg_4v5_crb"></a>Defining Deferred Endpoints for Sublevel Data

Because a page doesn't need to retrieve sublists during page load, you can use deferred endpoints to populate the `monikerLevel` sublists. A deferred endpoint for sublevel data returns dynamic, drill-down information based on the value that the user selected at each list level.

To define a deferred endpoint for sublevel data:

-   Set `"deferred": "true"`.
-   In the `url`, include `<instanceListId>.promptSelections[<listLevel>]` as an endpoint parameter.

    `<instanceListId>.promptSelections[<listLevel>]` contains the value that the user selected at the current list level.

    Examples:

    -   `organizationSubordinatesList.promptSelections[0]` returns the selected value at the root level.
    -   `organizationSubordinatesList.promptSelections[1]` returns the selected value at the second level.

-   Ensure that the deferred endpoint data contains the same id and display fields defined by the `idKey` and `displayKey` attributes at the root level `instanceList`. You can't set `idKey` and `displayKey` at the `monikerLevel`.


In this sample `endPoints[]`:

-   `supervisoryOrganizations` returns the root level.
-   `orgChart` returns the second level, based on the user selection at the root level.
-   `orgChartSingleton` returns the third level (leaf nodes). This endpoint is a singleton `orgChart` endpoint that uses 2 path parameters: user selection at the root level, and user selection at the second level.


```
"endPoints" : [
 {
   "baseUrlType": "workday-staffing",
   "name": "supervisoryOrganizations",
   "authType": "sso",
   "url": "/supervisoryOrganizations"
 },
 {
   "name": "orgChart",
   "baseUrlType": "workday-staffing",
   "authType": "sso",
   "url": "<% '/supervisoryOrganizations/' + organizationSubordinatesList.promptSelections[0]
            + '/orgChart' %>",
   "deferred":"true"
 },
 {
   "name": "orgChartSingleton",
   "baseUrlType": "workday-staffing",
   "authType": "sso",
   "url": "<% '/supervisoryOrganizations/' + organizationSubordinatesList.promptSelections[0]
            + '/orgChart/' + organizationSubordinatesList.promptSelections[1]%>",
   "deferred":"true"
 },
 . . .
]
```

## <a id="section_ub3_p3v_crb"></a>Using a Script with Level Values

In some cases, you might have an endpoint that returns values for multiple sublevels in a multilevel list. You can use PMD Scripting to extract the list values from the data collection, and use them as the `levelValues` attribute in the appropriate `monikerLevel`.

In the preceding example, the sample `instanceList` uses the `orgChart` endpoint, which actually contains the `subordinates[]` data collection.

In this next example, we use the same 3-level `instanceList`, but only with 1 deferred endpoint, `orgChart`. In this example, we’ve renamed the `orgChart` endpoint to `orgChartSubordinates`.

```
{
  "type": "instanceList",
  "label": "Select subordinate orgs",
  "multiSelect": "true",
  "id": "orgChartSubordinatesList",
  "values": "<% supervisoryOrganizations.data %>",
  "monikerLevels": [
    {
      "type": "monikerLevel",
      "levelValues": "<% orgChartSubordinates.data %>",
      "endPoint": "<% endpoints.orgChartSubordinates %>"
    },
    {
      "type": "monikerLevel",
      "levelValues": "<%
          var selections = orgChartSubordinatesList.promptSelections;
          var id = selections[selections.size() - 1];
          var target = orgChartSubordinates.data.find(item => {item.id == id});
          target.subordinates; %>",
      "endPoint": "<% endpoints.orgChartSubordinates %>"
    }
  ]
}
```

In the `levelValues` attribute of the `monikerLevel` that displays the leaf nodes, the script:

-   Saves the `id` of the selected value at the second level.
-   Finds the `id` in the `data[]` from the `orgChartSubordinates` endpoint.
-   Returns the `subordinates[]` from the specific orgChart data instance.


This snippet displays the `subordinates[]` in a sample data collection from the `orgChartSubordinates` endpoint:

```
{
 "data": [
   {
     "descriptor": "Human Resources",
     "id": "e02485f863ec48d39a082bb95cc4abe4",
     "subordinates": [
       {
         "managers": [
           {
             "descriptor": "Tammy Calhoun",
             "id": "38f11d6f8308434db162c04e37123c14"
           }
         ],
         "name": "Belonging & Diversity",
         "descriptor": "Belonging & Diversity Department",
         "Organization_Reference_ID": "SUPERVISORY_ORGANIZATION-16-269",
         "id": "1b5884fa4a3b014bc767acb6b910a101",
         "inactive": false
       },
       {
         "managers": [
           {
             "descriptor": "Logan McNeil",
             "id": "3aa5550b7fe348b98d7b5741afc65534"
           }
         ],
         "name": "HR Services",
         "descriptor": "HR Services Department",
         "code": "HR_Services_supervisory",
         "Organization_Reference_ID": "SUPERVISORY_HR_Services_Department",
         "id": "1f8ff0a1f91410f6ca2ff325183d0a09",
         "inactive": false
       },
       . . .
     ],
     . . .
   }
 ],
 "total": 1
}
```

The endpoint definitions used by `orgChartSubordinatesList`:

```
{
  "baseUrlType": "workday-staffing",
  "name": "supervisoryOrganizations",
  "authType": "sso",
  "url": "/supervisoryOrganizations"
},
{
  "name": "orgChartSubordinates",
  "baseUrlType": "workday-staffing",
  "authType": "sso",
  "url": "<% '/supervisoryOrganizations/' + orgChartSubordinatesList.promptSelections[0]
           + '/orgChart' %>",
  "deferred":"true"
}
```

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

Android, iOS

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

-   <b>endPoint</b>

    Data type: binding-EndPoint

    The deferred endpoint that returns a data collection for an instance list level. We call this endpoint only when the user clicks the instance list level. The fetched data must contain the default `id` and `descriptor` fields, or the `idKey` and `displayKey` fields if specified at the root level.

    The `levelValues` attribute must reference this endpoint.

-   <b>levelValues</b>

    Data type: binding-List

    Specifies a binding to the list of values at this sublevel.



