Why PMD onLoad Cannot Auto-Redirect to Another Page (and How to Use Conditional Pods)
Workday Extend Presentation Metadata (PMD) does not expose an imperative navigation or redirect method that fires during the onLoad page lifecycle. Page-to-page navigation in Workday Extend only occurs when a user clicks a button (linked to a taskId), clicks an externalLink, or submits an edit page that triggers a flowDefinitions transition in the Application Metadata (.amd) file.
When you need a user opening a task to see one of two completely different page experiences based on an inbound WQL or REST check at load time—for example, showing an Enrollment Form if the worker has not enrolled yet, or an Enrollment Summary page if a record already exists—encapsulate each experience inside its own Pod (.pod) and conditionally render the matching pod on a single host PMD page:
{
"id": "enrollmentRouterPage",
"endPoints": [
{
"name": "workerEnrollmentCheck",
"baseUrlType": "wql",
"authType": "sso",
"url": "<% '/data?query=' + string:urlEncode('SELECT workdayID, status FROM customApp_enrollments WHERE worker = \\'' + currentLoggedInUser.id + '\\' LIMIT 1') %>"
}
],
"presentation": {
"pageType": "edit",
"title": {
"type": "title",
"label": "Program Enrollment"
},
"body": {
"type": "section",
"id": "routerBodySection",
"children": [
{
"type": "pod",
"podId": "newEnrollmentFormPod",
"render": "<% empty(workerEnrollmentCheck.data) %>"
},
{
"type": "pod",
"podId": "existingEnrollmentSummaryPod",
"render": "<% !empty(workerEnrollmentCheck.data) %>"
}
]
}
}
}Because render is evaluated on the server during page load after inbound endPoints complete, only the matching pod is instantiated and sent to the browser. If the two experiences require different pageType behaviors (for example, an edit page versus a read-only view page with no OK button), use a lightweight landing view page with conditional button widgets whose taskReference routes the user to the appropriate target taskId.
Switching Sections with Buttons: Use multiStepLayout or editWizard Instead of tabBar
When designing a long data-entry form, developers often group sections into a six-tab tabBar layout and then attempt to add a Proceed to Next Tab button at the bottom of each tab.
In Workday Extend PMD:
buttonwidgets navigate between separate PMD tasks (taskId) or external URLs.pageActionButtonwidgets run PMD scripts on the current page, buttabBardoes not expose a scripting method (such assetActiveTab()) to switch the selected tab programmatically.
If your users require guided Next and Previous button navigation across sections of a single PMD page, replace tabBar with multiStepLayout (up to 10 steps, supported on both view and edit pages as the top-level tag inside body) or editWizard:
{
"id": "onboardingProfilePage",
"endPoints": [],
"presentation": {
"pageType": "edit",
"title": {
"type": "title",
"label": "Onboarding Profile"
},
"body": {
"type": "multiStepLayout",
"id": "onboardingWizard",
"steps": [
{
"type": "layoutSection",
"id": "step1WorkerDetails",
"children": [
{
"type": "fieldSet",
"id": "workerFieldSet",
"title": "Step 1: Worker Details",
"children": [
{
"type": "text",
"id": "workerName",
"label": "Full Name",
"required": true
}
]
}
]
},
{
"type": "layoutSection",
"id": "step2Equipment",
"children": [
{
"type": "fieldSet",
"id": "equipmentFieldSet",
"title": "Step 2: Equipment and Access",
"children": [
{
"type": "instanceList",
"id": "equipmentType",
"label": "Equipment Type",
"instanceList": [
{ "id": "LAPTOP", "descriptor": "Laptop" },
{ "id": "DESKTOP", "descriptor": "Desktop" }
]
}
]
}
]
}
]
}
}
}multiStepLayout automatically renders numbered progress steps at the top of the page and provides built-in step navigation controls without requiring custom taskId transitions. Note that multiStepLayout must be the root widget of body and cannot be nested inside a pod.
Understanding flowVariables Server-Side State and Data Volume Limits
When passing data from one PMD page to the next inside an .amd page flow (flowDefinitions), developers use an outboundVariable endpoint with "variableScope": "flow" and read the values on the destination page via flowVariables.
A common misconception is that flowVariables are stored purely in browser memory on the client. In reality, PMD scripting and flowVariables are server-side state managed by the Workday Extend presentation runtime. That is why flowVariables must be populated through an outboundVariable endpoint inside outboundData when the first page submits:
"outboundData": {
"outboundEndPoints": [
{
"type": "outboundVariable",
"name": "transitionOutboundVars",
"variableScope": "flow",
"values": [
{
"outboundPath": "batchRequestId",
"value": "<% createBatchRequest.id %>"
},
{
"outboundPath": "isValid",
"value": "<% !empty(createBatchRequest.id) %>"
}
]
}
]
}Because flowVariables are serialized into the server-side page context and transmitted between the browser and the Workday presentation server on page transitions, passing hundreds of grid rows or large nested JSON objects inside flowVariables increases network round-trip payload size, slows down next-page rendering, and risks hitting presentation state serialization limits.
Best Practice for Passing Multi-Row Grid Data Across Pages
Instead of serializing an entire 500-row grid array into flowVariables:
- Persist the grid rows to a Model Business Object on the first page (or save the filter criteria/parent record).
- Pass only the lightweight parent Business Object
idor query filter parameters insideflowVariables(as shown withbatchRequestIdabove). - Query the rows on the destination page using an inbound WQL or Business Object REST endpoint filtered by
flowVariables.batchRequestId.
How to Verify in the Tenant
- Deploy the host PMD page with conditional pods and open it with both an enrolled and an unenrolled user account to confirm that the
renderexpression displays the appropriate pod on load without requiring a second click. - Open the
multiStepLayoutpage and verify that users can step forward and backward acrosslayoutSectionsteps before submitting the page. - Inspect network timing and View Application Logs when transitioning across pages in a
flowDefinitionsflow, confirming that only lightweight identifiers are passed inflowVariableswhile the destination page fetches the grid rows via its inbound endpoint.