---
nav: wcp_docs
parent_url: /wcp_docs/
title: Display Information on a View Page
layout: subsection
---

Module length is approximately 30 minutes

## <a id="before-you-begin"></a>Before You Begin: Create an Account on the Workday Build Platform

To do this activity, you must have an account on the Workday Build platform and a development tenant. If you’ve already created an account and a tenant, you can go to the first task of this activity.

If you haven’t already created an account, you can do so now. It’s free!

1.  Go to the [Workday Build Platform](https://developer.workday.com) and create an account with your personal email address.
2.  Once you have created an account, sign in to the [Workday Build Platform](https://developer.workday.com).
3.  In the upper-left corner, select the hamburger menu, and under <b>Console</b>, select <b>Tenants</b>.
4.  On the <b>Tenants</b> page, select <b>Create Tenant</b>. It will take 1 to 2 minutes for the development tenant to be created.
5.  Check your personal email for a link to change your tenant password.

    <b>Note:</b> Remember the password. You’ll need to sign in to the tenant while you do this activity.

6.  Sign in to the tenant with the username <i>lmcneil</i> and the password that you just created.


<b>Note:</b> When you sign in to the development tenant with the username <i>lmcneil</i>, you’re signing in as the persona <i>Logan McNeil</i>. Logan is one of several user accounts that you can use to test the agents and app that you create and deploy to your development tenant.

## Task #1: Create an App

Let’s start by creating an Extend app and examining the presentation components that you’ll configure to define the app’s user interface (UI).

1.  Download the [changeWorkLocationStarterCode.zip](GUID-700468c6-0c57-485e-9152-cf98480ad54c.zip) ZIP file.
2.  Navigate to the [Workday Developer Site](https://developer.workday.com/) and select <b>Build an Extend App</b>.
3.  Select <b>Upload a Zip File.</b>
4.  In the Name field, enter <i>Change Work Location App</i>. You’ll see that the Reference ID is populated automatically based on the name you give the app.
5.  Select, or drag and drop, the [changeWorkLocationStarterCode.zip](GUID-700468c6-0c57-485e-9152-cf98480ad54c.zip) file that you downloaded.
6.  Select <b>Create and Edit</b>. This will open App Builder.


Using the starter code, you’ve created a new app that includes three presentation components: <i>App Metadata (AMD)</i>, <i>Site Metadata (SMD)</i> and a page called <i>changeWorkLocation</i>. In the following tasks, you’ll use Extend presentation components to create a functional user interface for the app.

![](GUID-ca5b2a12-1a91-4f74-8999-1772d295d562.png)

## Task #2: Add a Home Page

In this task, you’ll add a home page to the app. This will be the first page users we’ll see when they launch the app, so you’ll need to set it as the root page of the app.

1.  In the Main Content panel, select <b>Add Component</b>:

    1.  In the Type field, select <b>Page</b>.
    2.  In the Name field, enter <i>home</i>.
    3.  Select <b>Done</b>.

2.  In the left-hand Component panel, select the <b>AMD</b> component.
3.  Near the top of the AMD component, find the <b>“tasks”: [ ]</b> array. The tasks array contains page declarations and their corresponding URL routing pattern. You’ll see there are two tasks that correspond to the pages in your app: <i>changeWorkLocation</i>and <i>home</i>.
4.  In the home task, change the `routingPattern`to <b>“/”</b>. This makes the home page the root page of the app.![](GUID-0298abbb-62be-49be-a956-819d890f4a81.png)
5.  In the left-hand Components panel, under the Pages section, select the <b>home</b> page.
6.  In the Page Type field, select <b>View</b>. A View page displays read-only information.
7.  To preview the home page, select the App Preview icon, which is located to the right of the Visual toggle. This will open the App Preview Window.
8.  You’ll see a simple page with a Title widget that displays “Workday Extend” and a Text widget that displays a Label (“Hello World!”) and underneath, a short string of text (“Welcome from Workday”).
9.  At the top of the App Preview window, select <b>MOCK DATA</b>, select your development tenant, select <b>Connect,</b> and sign in to the tenant. This enables App Preview to display data from data sources in the tenant.
10. At the top of the App Preview window, to the left of the close icon, select the <b>App Preview Pop-Up icon</b>. This opens a new browser window and enables you to quickly toggle to a preview of the page to test your code changes.
11. Return to App Builder and select <b>Save to App Hub</b> to save your changes so far.![](GUID-e29fcf66-dd88-49c0-9de7-523bd8e57086.png)

    <b>App Preview Pop-Out</b> enables you to preview and test your code changes in a separate, resizable browser window directly from App Builder. By decoupling the preview from the main workspace, it enables faster iteration, side‑by‑side comparisons, and more realistic validation of how the app will look and behave for end users.



## Task #3: Add Buttons for Navigation

Now that you have two pages in your app, you need to create a way for your users to navigate between them. You can do this with the button tag.

1.  Select the <b>home</b> page.
2.  In the main content panel, hover over the area below the Text tag, and when it appears, select <b>+ Add Tag in Section</b>.
3.  Search and select <b>button</b>.![](GUID-b53245da-690c-4aa3-89d8-ccbede522bdb.png)
4.  Expand the Button tag to show all attributes.
5.  In the ID field, enter <i>navToChangeWorkLocation</i>.
6.  In the Label field, enter <i>Change Work Location</i>.
7.  In the Action field, select <b>Primary</b>. Primary is the type of button used for navigation.
8.  Return to the button tag on the home page and select <b>+ Add Task Reference</b>.
9.  In the Task ID field, enter <i>changeWorkLocation</i>. Remember that task ID references the task in the AMD that defines the routing pattern for the changeWorkLocation page routing.
10. Select the changeWorkLocation page, hover over the area below the Rich Text tag, select <b>+ Add Tag in Field Set</b>, and select <b>Button</b>.
11. In the button tag:

    1.  Set the ID to <i>returnHome</i>.
    2.  In the Label field, enter <i>Return Home</i>.
    3.  In the Action attribute, select <b>Link</b>.
    4.  Select <b>+ Add Task Reference</b>, and in the Task ID field, enter <i>home</i>.

12. Refresh the App Preview and test the navigation:

    1.  On the home page, select the <b>Change Work Location</b> button. It should display the changeWorkLocation page.
    2.  On the changeWorkLocation page, select the <b>Return Home</b> link,

13. Select <b>Save to App Hub</b>.![](GUID-4cc818ac-8881-4d8a-8f02-8bdb89709ca4.gif)


## Task #4: Edit the Home Page

When you created the home page, App Builder generated PMD tags to define the layout and content of a simple page. PMD tags define:

-   What appears on the page (examples: sections, titles, text, buttons, form fields).
-   How those elements are laid out.
-   How elements behave (examples: as read‑only on a View page. as editable on an Edit page).


1.  On the upper-right corner of the home page, select the <b>Visual mode</b> toggle and switch it to <b>Code</b> mode. This will enable you to view and edit the JSON code.

    -   The <b>presentation</b> is a schema area where layout and content tags define the page structure and display content. In Visual mode, these tags appear under the Page tab.
    -   The <b>body</b> tag defines the main content area; it holds the core UI elements (text, form fields, buttons, sections, etc.) that users interact with.
    -   The <b>footer</b> tag defines the page’s bottom region, used for secondary or persistent elements such as action buttons (Submit, Cancel, Return Home), helper links, or legal/disclaimer text.

2.  Look at the “title” tag and notice that it has two attributes:

    -   The <b>type</b> attribute specifies <i>what kind of widget or layout element</i> that tag represents. It tells the Extend rendering engine to render a page title.
    -   The <b>label</b> attribute defines the content to be displayed in the page title.

3.  In the Title’s label field, replace Workday Extend with <i>Change Work Location App</i>.
4.  Find the Text tag with id <b>hello</b>, select <b>Text</b> to change type, and search for, and select, <b>Rich Text</b>. A Rich Text tag enables you to format text using HTML tags.
5.  In the Rich Text tag’s Value field, copy and paste the text below.`Welcome to the<span style="color:blue;"> Work Location App</span>. Select the <b>Change Work Location</b> button to get started.`
6.  Hover over the <b>Button</b> tag, select and hold the waffle icon, and drag the button below the Rich Text tag, and drop it.
7.  Refresh the <b>App Preview</b> icon and verify that your changes appear as shown in the image below.
8.  Select <b>Save to App Hub</b>.


![](GUID-5757661d-d32f-4837-9155-fa7514b0947c.png)

## Task #5: Add a Logo to the Home Page

In this task, you’ll use the Image tag to display a logo on the home page. The Image tag references a uniform resource identifier (URI) that points to a server where the image is stored.

You can display images via a Workday API endpoint that points to a standard or custom (Extend) business object that stores attachments, such as worker photos.

Alternatively, you can display images that are hosted on a third server. In this example, you’ll display an image hosted on [Wikimedia Commons](https://commons.wikimedia.org/wiki/Main_Page).

1.  On the home page, hover over the area above the Rich Text tag, select <b>Add tag in section</b>, search for and select <b>Image</b> tag.
2.  Expand the tag to show all attributes.
3.  In the <b>ID attribute</b> field, enter <i>logo</i>.
4.  In the <b>Image Uri attribute</b> field, enter the address where the logo is stored in Wikimedia Commons: [https://upload.wikimedia.org/wikipedia/commons/8/80/Workday_logo.svg](https://upload.wikimedia.org/wikipedia/commons/8/80/Workday_logo.svg).
5.  In the <b>Sizing Hint</b> field, enter <i>Thumbnail</i>.
6.  Refresh <b>App Preview</b> to check your code changes. The home page should look like the one in the image below.
7.  Select <b>Save to App Hub</b>.


![](GUID-632a8122-0f61-4458-b3d2-35afa3e3b731.png)

## Task #6: Get Data from a Workday API Endpoint

So far, you’ve used PMD tags to display static text and images. However, for the best user experience, you’ll want to create an app that dynamically displays data that is up-to-date and relevant to the user.

You can do this by calling a Workday or external API data source and bind it to a PMD tag.

In this task, you’ll add an Inbound Endpoint to the home page that will get the current user’s name. In the next task, you’ll dynamically display the user’s name in the home page’s welcome message.

1.  At the top of the home page, select the <b>Page Load</b> tab and select <b>Add Inbound Endpoint</b> &gt; <b>REST endpoint</b>.
2.  Enter a name for the endpoint: <i>getUserName</i>.
3.  The HTTP Method should be set to GET, which is the default.
4.  In the Base URL Type, enter <i>staffing</i>. <b>Staffing</b> is the key of a data provider that is already declared in the AMD component.

    <b>Note:</b> In the AMD component, the dataProviders array contains the base URL paths of the REST endpoints. When you create a key-value pair in the AMD’s dataProviders array, you can use the key to reference the base URL path from other components in your app.

5.  In the URL field, enter <i>/workers/me</i>, where the key word <b>me</b> is used to indicate the current user’s id.
6.  Select Authentication & Headers, and in the Auth Type field, enter <i>sso</i>.
7.  Select <b>Save to App Hub</b>.


![](GUID-3bb865e3-fe7f-4f55-bec4-93eaa8054f84.png)

<BOX>

<b>Note:</b> Use [REST API Explorer](https://developer.workday.com/rest-api-explorer/overview) to create and test API endpoints.

## Task #7: Test the Endpoint with App Preview Pop-Up

App Preview Pop-Up enables you to quickly test the performance of a page, including API endpoints.

In this task, you’ll use App Preview Pop-Up’s Page State feature to verify that the getUserName inbound endpoint is returning the data that you want.

1.  Open App Preview, if it isn’t already. Make sure App Preview is connected to your tenant. Select <b>MOCK DATA</b> and sign in to your tenant.
2.  Select the <b>App Preview Pop-Up</b> icon to launch App Preview in a separate browser window.
3.  At the bottom of the App Preview Pop-Out window, notice two tabs:

    1.  <b>Scripts Console</b>: Displays any console logs from any PMD script on the page. You can write and execute any PMD scripts against your current preview page for Edit Page Types.
    2.  <b>Page State:</b> Enables you to explore different values and data from variables, endpoints, and tags.

4.  Select the <b>Page State</b> tab.
5.  Select <b>> endpoints</b> and then select <b>> getUserName</b>. This shows you information about the Inbound Endpoint results. In this case it returns a worker object with fields containing the worker’s information.


If the getUserName endpoint worked correctly, you’ll see one object with a “descriptor” field containing the workers name. In this example, the worker is Logan McNeil.

![](GUID-da94c9e3-3efd-4278-aff1-cc480f295fb2.png)

## Task #8: Dynamically Display User’s Name on the Page

Let’s edit the hello Rich Text tag on the home page so that it welcomes the user by name:

1.  Return to App Builder, select the <b>home</b> page, and select the <b>Presentation</b> tab.
2.  In the hello Rich Text tag’s <b>Label</b> field, delete <b>Home Page</b>, and select the <b></></b> icon to change the field to a scripted value.
3.  In the Label field, enter: <b>'Hello ' + getUserName.descriptor + '!'</b>
4.  Refresh the App Preview window to check your code changes. You should see a personal greeting, similar to the one in the image below.
5.  Select <b>Save to App Hub</b>.


![](GUID-019b4ac2-01dd-4a42-b5a8-d1a5a7f9a883.png)

