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

<a id="section_N10021_N1001E_N10001"></a>
Contains a reference to the task (page) that users navigate to when they click a `button`, `buttonGroup`, or `dropDownButton`. You can include parameters to send to the page.

Use `taskReference` on view and edit pages.

Jump to:

-   [Mobile Support](/wcp_docs/cgt1531499518059.html#section-mobile-support)
-   [Attributes](/wcp_docs/cgt1531499518059.html#section-attributes)


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

## <a id="section_navigatePage"></a>Navigating to a Page

Use `taskReference` within button widgets to specify the page to navigate to. In the `taskReference` attribute, specify the `taskId` of the page.

<b>Note:</b> A PMD page corresponds to a task, as defined in the `tasks[]` array in the App Metadata (AMD). The `taskId` in `taskReference` must be a valid task `id` in `tasks[]` in the AMD. Ensure that you specify the task `id`, not the `page` `id`. If you specify an incorrect `taskId` in `taskReference`, you'll get an error with the HTTP status code 404.

The `taskReference` attribute in this sample `button` navigates to the sample <i>manageMyDonations</i> task, which corresponds to a sample <i>manageMyDonations.pmd</i>.

```
{
  "type": "button",
  "action": "PRIMARY",
  "label": "My Charitable Donations",
  "taskReference": {
    "taskId": "manageMyDonations"
  }
}
```

The task definition in the AMD for the <i>manageMyDonations.pmd</i>, whose task `id` is <i>manageMyDonations</i>:

```
"tasks": [
  {
    "id": "manageMyDonations",
    "routingPattern": "/myDonations",
    "page": {
      "id": "manageMyDonations"
    }
  },
  . . .
]
```

<b>Note:</b> If the `routingPattern` of the task definition in the AMD contains path parameters, the parameter bindings in `taskReference` must match the path parameters in the `routingPattern`. To reference path parameters, use the `routeParams` predefined app variable. For more details about route parameters, see:

-   `routingPattern` under <i>tasks</i> in [Reference: Extend App Metadata](/wcp_docs/btj1547749859781.html).
-   `routeParams` in [Reference: Predefined App Variables](/wcp_docs/urd1528494500512.html).


## <a id="section_parameterBindings"></a>Sending Key-Value Parameter Bindings to a Page

To send key-value parameters to the next page, specify the `parameterBindings` attribute in `taskReference`.

The `taskReference` in this sample `button` specifies `parameterBindings`, which sends the <i>charityId</i> parameter to the next page.

```
{
  "type": "button",
  "action": "AUXILIARY",
  "label": "Update",
  "taskReference": {
    "taskId": "updateCharity",
    "parameterBindings": {
      "charityId": "<% charity.id %>"
    }
  }
}
```

The next page can reference the parameter bindings using the `queryParams.` <i>aParameterName</i>. The <i>aParameterName</i> variable is a key in `parameterBindings` of the `taskReference` (from the previous page).

Example: The <i>updateCharity</i> page references the <i>queryParams.charityId</i> parameter in the endpoint url:

```
{
  "name": "charity",
  "baseUrlType": "app",
  "url": "<% 'charities/' + queryParams.charityId %>",
  "authType": "sso"
}
```

## <a id="section_parameters"></a>Sending Object Parameters to a Page

While the `parameterBindings` attribute of `taskReference` sends key-value parameter bindings to the next page, the `parameters` attribute enables you to send a map object binding to the next page. In this next example, the `taskReference` sends both a simple parameter <i>startDate</i> and a map object parameter <i>expenseEntry.expenseEntryStatus</i>.

```
{
  "type": "button",
  "id": "expenseDetailsButton",
  "label": "Expense Details",
  "action": "AUXILIARY",
  "taskReference": {
    "taskId": "expenseDetails",
    "parameterBindings": {
      "startDate": "2021-03-15"
    },
    "parameters": "<% expenseEntry.expenseEntryStatus %>"
  }
}
```

The sample <i>expenseEntry.expenseEntryStatus</i> map object contains these fields:

```
{
  "descriptor": "New",
  "id": "dc74b9a0446c11de98360015c5e6daf6"
}
```

<b>Note:</b> We combine entries from both `parameters` and `parameterBindings`. If there is a duplicate entry, then the entry in `parameterBindings` takes precedence.

To reference the fields in the map object in the next page, use `queryParams.` <i>aParameterName</i>. The <i>aParameterName</i> variable is a field in the map object in `parameters` of the `taskReference` (from the previous page).

Example: These text widgets from the sample <i>expenseDetails</i> page reference the parameter bindings from the sample button. Note that <i>queryParams.descriptor</i> references the <i>descriptor</i> field in the <i>expenseEntry.expenseEntryStatus</i> map object.

```
{
  "type": "text",
  "label": "Start date",
  "value": "<% queryParams.startDate %>"
},
{
  "type": "text",
  "label": "Expense status",
  "value": "<% queryParams.descriptor %>"
}
```

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

Android, iOS

## <a id="section-attributes"></a>Attributes

-   <b>parameterBindings</b>

    Data type: Map<String, Binding<String>>

    A map containing task parameters sent to the specified `taskId` (page). You can use `parameterBindings` to specify a set of key-value parameters:

    -   <i>parameterKey</i> - A static string that identifies the parameter value in the destination page. The destination page can reference the parameter using <i>queryParams.parameterKey</i>. Don't use the reserved keyword "type" as a <i>parameterKey</i>.
    -   <i>parameterValue</i> - A binding string that contains the parameter value.

    This sample sends 2 parameters: a static date and the `expenseEntryStatus.descriptor` field from the <i>expenseEntry</i> endpoint.

    ```
    "taskReference": {
    "taskId": "expenseDetailsOnStartDate",
    "parameterBindings": {
      "startDate": "2021-03-15",
      "expenseStatus": "<% expenseEntry.expenseEntryStatus.descriptor %>"
    }
    }
    ```

    The sample <i>expenseEntry.expenseEntryStatus</i> object contains this sample JSON:

    ```
    {
    "descriptor": "New",
    "id": "dc74b9a0446c11de98360015c5e6daf6"
    }
    ```

    The sample <i>expenseDetailsOnStartDate</i> page can reference the parameters as <i>queryParams.startDate</i> and <i>queryParams.expenseStatus</i>. Note that the `id` field isn't available because the sample `parameterBindings` doesn't include the `id` parameter.

    <b>Note:</b> We combine entries from both `parameters` and `parameterBindings`. If there is a duplicate entry, then the entry in `parameterBindings` takes precedence.

-   <b>parameters</b>

    Data type: binding-Map

    A binding to a map object containing parameters sent to the specified `taskId` (page). You can use `parameters` to specify a map object containing the parameters. Example:

    ```
    "taskReference": {
    "taskId": "expenseDetails",
    "parameters": "<% expenseEntry.expenseEntryStatus %>"
    },
    ```

    The sample <i>expenseEntry.expenseEntryStatus</i> object contains this sample JSON:

    ```
    {
    "descriptor": "New",
    "id": "dc74b9a0446c11de98360015c5e6daf6"
    }
    ```

    The sample <i>expenseDetails</i> destination page can reference the parameters as <i>queryParams.descriptor</i> and <i>queryParams.id</i>.

    <b>Note:</b> We combine entries from both `parameters` and `parameterBindings`. If there is a duplicate entry, then the entry in `parameterBindings` takes precedence.

-   <b>taskId</b>

    Data type: binding-String

    (Required) The id of the task (page) to navigate to. Define the task ID in the `tasks` section of the AMD. Each task ID corresponds to a PMD page.



