---
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, UI components]
nav: wcp_docs
parent_url: /wcp_docs/
title: >- 
  Reference: PMD Pods
layout: subsection
---

<a id="section_N10021_N1001E_N10001"></a>
A pod is a reusable PMD code that you define once and invoke from multiple PMDs. Define a pod in a `.pod` file, and reference the pod as a `pod` tag in the PMD.

## <a id="podDefinition"></a>Pod Seed Definition

A pod seed defines the reusable PMD code, and consists of these properties:

<table><thead><tr><th>Property</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td>podId</td><td>string</td><td>Yes</td><td>The unique ID of a pod. PMDs reference the <code>podId</code> to invoke the pod.</td></tr><tr><td>seed</td><td>object</td><td>Yes</td><td>Contains the template widget and invocation parameters.</td></tr></tbody></table><br/>

The `seed` object contains these properties:

<table><thead><tr><th>Property</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td>parameters</td><td>array</td><td>No</td><td><p>Contains parameter names used for passing variable data to the pod. Because different PMDs can call the same pod in various contexts, use <code>parameters</code> to pass dynamic values to the pod.</p></td></tr><tr><td>template</td><td>{tagObject}</td><td>Yes</td><td><p>Contains the template widget. The template defines the structure and data of the pod.</p> <p>Presentation Components replace any template parameters with values passed by the PMD that invoked the pod.</p> <p>The template can contain embedded parameters. To embed parameters in the template, use this notation: <code>@@parameterName@@</code>.</p></td></tr><tr><td>endPoints</td><td>array</td><td>No</td><td><p>Contains inbound endpoints that fetch the data displayed on the template widgets.</p> <p>The <code>endPoints</code> schema in the pod seed is the same as the <code>endPoints</code> schema in the PMD.</p></td></tr></tbody></table><br/>

When you create a pod in App Builder, it creates a `.pod` file containing the pod seed definition.

Example:

```
{
 "podId": "textPod",
 "seed": {
   "parameters": [
      "valueParam"
   ],
   "template": {
     "type": "text",
     "value": "<% @@valueParam@@ %>"
   }
 }
}
```

<b>Notes</b>:

-   The `.pod` file has a maximum file size of 100 KB.
-   Because pod templates apply to widgets, only the widget-level PMD Scripting events apply to pods:

    -   `onChange`
    -   `onClick`
    -   `onRowAdd`
    -   `onRowRemove`
    -   `onRowSelect`

    Don't use these PMD Scripting events in pods:

    -   `onLoad`
    -   `onSend`
    -   `onSubmit`



## <a id="podInvocation"></a>Pod Tag in a PMD

To invoke a pod from a PMD, use the `pod` tag within the `presentation` section of the PMD.

The `pod` tag has these attributes:

<table><thead><tr><th>Pod Attribute</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td>podId</td><td>string</td><td>Yes</td><td>The ID of the pod to invoke. A pod with the specified <code>podID</code> must exist in the <code>pods</code> folder of your app.</td></tr><tr><td>parameters</td><td>object</td><td>No</td><td>Contains custom key/value pairs that define the parameter values passed to the pod.</td></tr></tbody></table><br/>

During the preprocessing of a PMD, Presentation Components replace a `pod` tag in the PMD with the pod template. The parameter values passed by the invoking PMD replace the corresponding parameters within the pod template. These replacements happen before any data fetch from the inbound endpoints.

Example:

This sample `pod` tag invokes the pod `textPod`, and passes `valueParam` with a text value.

```
{
  "type": "pod",
  "podId": "textPod",
  "parameters": {
    "valueParam": "Enter a description."
  }
}
```

This PMD snippet is the result of the `pod` tag replacement:

```
{
  "type": "text",
  "value": "Enter a description."
}
```

## <a id="parameterReplacementRules"></a>Parameter Replacement Rules

When you invoke a pod in your PMD, you can use expressions to pass your parameters. If your PMD or pod uses PMD Scripting, use the `<% %>` binding notation.

Consider the various ways you can pass a parameter binding in your pod invocation. This table uses `y` as the sample parameter, using the PMD Scripting binding notation:

<table><thead><tr><th>Parameter invocation</th><th>Template parameter</th><th>Parameter replacement</th></tr></thead><tbody><tr><td><code>"y" : "<% x %>"</code></td><td><p><code><% @@y@@ %></code></p> <p><code><% string:concat(@@y@@, 'a') %></code></p></td><td><p><code><% x %></code></p> <p><code><% string:concat(x, 'a') %></code></p></td></tr><tr><td><code>"y" : "<% x %>"</code></td><td><code>@@y@@</code></td><td><code><% x %></code></td></tr><tr><td><code>"y" : "x"</code></td><td><p><code><% @@y@@ %></code></p> <p><code><% string:concat(@@y@@, 'a') %></code></p></td><td><p><code><% 'x' %></code></p> <p><code><% string:concat('x', 'a') %></code></p></td></tr><tr><td><code>"y" : "x"</code></td><td><code>@@y@@</code></td><td><code>x</code></td></tr></tbody></table><br/>

Example:

This PMD snippet invokes a pod named `aTextPod` with the `defaultText` parameter.

```
{
  "type": "pod",
  "podId": "aTextPod",
  "parameters": {
    "defaultText": "<% 'Sample text' %>"
  }
}
```

The sample `aTextPod` displays the value of the input `defaultText` parameter.

```
{
  "podId": "aTextPod",
  "seed": {
    "parameters": [
      "defaultText"
    ],
    "template": {
      "type": "text",
      "value": "<% @@defaultText@@ %>",
      "enabled": false
    }
  }
}
```

## <a id="parameterValues"></a>Parameter Variables and Hard-Coded Values

When you invoke a pod, you can pass parameters either as bindings or hard-coded values. Consider this sample pod:

```
{
  "podId": "textPod",
  "seed": {
    "parameters": [
      "valueParam",
      "typeParam"
    ],
    "template": {
      "type": "@@typeParam@@",
      "value": "<% @@valueParam@@ %>"
    }
}
```

This PMD snippet illustrates a pod invocation with parameters `valueParam` as a binding and `typeParam` as a hard-coded value.

```
{
  "type": "pod",
  "podId": "textPod",
  "parameters": {
    "valueParam": "<% param1 %>",
    "typeParam": "text"
  }
}
```

Using the sample `<% param1 %>` binding, this PMD snippet displays the PMD replacement.

```
{
   "type": "text",
   "value": "<% param1 %>"
}
```

This next PMD snippet uses hard-coded values for both parameters.

```
{
  "type": "pod",
  "podId": "textPod",
  "parameters": {
    "valueParam": "value1",
    "typeParam": "text"
  }
}
```

Using the sample `value1` hard-coded value, this PMD snippet displays the PMD replacement.

```
{
   "type": "text",
   "value": "<% 'value1' %>"  
}
```

## <a id="multipleWidgets"></a>Multiple Widgets in a Pod

To define multiple widgets in a pod template, specify a `section` tag with a `children` array containing multiple widgets:

```
{
  "type": "seed",
  "template": {
    "id": "helpTextSection",
    "type": "section",
    "children": [
      {
        "type": "richText",
        "id" :"widget1",
        "value": "<% list:filter(awaitingTasksInfo.data, 'id', queryParams.eventRecordId)[0].stepHelpText %>"
      },
      {
        "type": "richText",
        "id" :"widget2",
        "value": "<% list:filter(awaitingTasksInfo.data, 'id', queryParams.eventRecordId)[0].stepHelpText %>"
      }
    ]
  }
}
```

## <a id="section_universalFooter"></a>Universal Footer Pod

You can define a pod for a universal footer that automatically renders on all pages of an app. To define a universal footer, specify the `footer` tag in the pod template. Note that the pod template must contain only the `footer` tag.

Pod Example:

```
{
  "podId": "myFooterPod",
  "seed": {
    "template": {
      "type": "footer",
      "children": [
        {
          "type": "richText",
          "value": "Universal footer for all pages.",
          "enabled": false
        }
      ]
    }
  }
}
```

To designate the footer pod as the universal footer, reference its `podId` in the `universalFooterPodId` property in the App Metadata (AMD).

AMD Example:

```
"universalFooterPodId": "myFooterPod",
```

<b>Note:</b> If a PMD contains another footer, the footer defined in the PMD takes precedence over the universal footer.

To override a universal footer, define the footer in the PMD. Note that If a PMD contains another footer, the footer defined in the PMD takes precedence over the universal footer.

## <a id="section_endpoints"></a>Pod Endpoints

You can include `endPoints[]` in a pod and use these endpoints in the pod template. Define `endPoints[]` in a pod seed the same way you define `endPoints[]` in a PMD.

<b>Note:</b> Use unique names for your pod and PMD endpoints. You can follow a naming convention for your pod endpoints to differentiate them from the PMD endpoints.

This sample pod uses a template image that displays the image URL returned by the pod endpoint:

```
{
  "podId": "aDogImagePod",
  "seed": {
    "endPoints": [
      {
        "name": "aDogPodEndpoint",
        "baseUrlType" : "dogsBaseUrl",
        "url": "/breeds/image/random",
        "authType": "NOAUTH"
      }
    ],
    "template": {
        "id": "dogImageId",
        "type": "image",
        "imageUri": "<% aDogPodEndpoint.message %>"
    }
  }
}
```

Similar to defining a PMD endpoint, the `dataProviders` subschema in the AMD contains the value of the `baseUrlType` of the endpoint. This AMD snippet displays the sample `dogsBaseUrl` data provider:

```
  "dataProviders": [
    {
      "key": "dogsBaseUrl",
      "value": "https://dog.ceo/api"
    }
  ],
```

This PMD snippet displays the pod invocation:

```
{
    "type": "pod",
    "podId": "aDogImagePod"
},
```

## <a id="section_param_endpoints"></a>Pod Endpoints with Parameters

If you need to pass parameters to your pod endpoints, you can use the `@@parameter@@` notation in the `url` value. A pod endpoint parameter enables you to pass variable data from different PMDs to the same endpoint.

<b>Note:</b> PMDs can invoke a pod with parameterized endpoints only a single time. Currently, you can't invoke a pod with parameterized endpoints multiple times within the same PMD.

This sample pod uses a section widget with an image returned by a pod endpoint. The sample endpoint `url` contains the `breed` parameter:

```
{
  "podId": "aBreedImagePod",
  "seed": {
    "parameters": [
        "breed"
    ],
    "endPoints": [
      {
        "name": "aBreedPodEndpoint",
        "baseUrlType" : "dogsBaseUrl",
        "url": "/breed/@@breed@@/images/random",
        "bestEffort": "true",
        "authType": "NOAUTH"
      }
    ],
    "template": {
        "id": "dogSectionId",
        "type": "section",
        "children": [
          {
            "id": "statusTextId",
            "type": "text",
            "label": "Fetch @@breed@@",
            "value": "<% aBreedPodEndpoint.status}",
            "enabled": false
          }, {
            "id": "dogImageId",
            "type": "image",
            "imageUri": "<% aBreedPodEndpoint.message}"
          }
        ]
    }
  }
}
```

This AMD snippet displays the sample `dogsBaseUrl` data provider:

```
  "dataProviders": [
    {
      "key": "dogsBaseUrl",
      "value": "https://dog.ceo/api"
    }
  ],
```

This PMD snippet displays the pod invocation that passes the `breed` parameter to the pod. In this example, the `breed` parameter uses a flow variable from an edit page with a dropdown widget. The `chosenBreed` variable stores the selected value from the dropdown list:

```
{
    "type": "pod",
    "podId": "aBreedImagePod",
    "parameters": {
        "breed": "<% flowVariables.chosenBreed %>"
    }
},
```

### Related Information

[Add Pods to an App](/wcp_docs/fxg1677268100051.html)

