Skip to main content

Build a Career Development Plan App in Power Apps — Part 4: Build the Home Screen

· 29 min read
Jagdish Kumawat
Founder @ Dewiride

The Career Development Plan app gets its first screen. When someone opens the app, the Home screen greets them by name and shows their job title and manager. Everyone sees a My plan button, and managers also see My team. Behind it are the app's named formulas, which every later screen reuses.

This is Part 4 of a 14-part series.

  1. Part 1: Plan the App and Set Up the Demo Organization
  2. Part 2: Create the SharePoint Site and Lists
  3. Part 3: Create the Solution, Environment Variables and Canvas App
  4. Part 4: Build the Home Screen (you are here)
  5. Part 5: Build the My Plan Screen
  6. Part 6: Build the Response Screen
  7. Part 7: Share the App and Build the My Team Screens
  8. Part 8: Build the Review Screen for Manager Approvals
  9. Part 9: Let Managers Manage Competencies
  10. Part 10: Test Every Role, Joiners and Leavers (coming soon)
  11. Part 11: Build a Setup Flow That Creates the SharePoint Lists (coming soon)
  12. Part 12: Run the Solution Checker and Export the Solutions (coming soon)
  13. Part 13: Install the App in a New Environment (coming soon)
  14. Part 14: Recap, Production Checklist and Next Steps (coming soon)

Part 3 created the solution and the canvas app, connected to Office 365 Users and the two SharePoint lists. This part writes the formulas that know who's using the app, and builds the Home screen from containers so that it fits a phone as well as a monitor. As before, each generic task has its own short guide, and this part gives you the exact values for this app. Every step ends with a picture of where things stand.

What You'll Build​

By the end of this part, the Home screen looks like this for the admin, the Managing Director at the top of the demo organization:

The Career Development Plan app running in preview, filling the window: a teal header with the app's name, an avatar with the initials AU, Welcome, Admin, Job title: Managing Director, a message that the profile has no manager, and the My plan and My team buttons

  • Modern controls and the Steel theme.
  • Six named formulas: the app's title, the signed-in person's profile and job title, their manager, their direct reports, and whether they're a manager.
  • The Home Screen, set as the start screen: a header with the app's name, the person's photo or initials, a welcome, their job title and manager, and two buttons.
  • A layout built from containers, checked at a phone size.
  • An accessible label on every control.

Prerequisites​

Step 1: Turn On Modern Controls​

Follow How to Turn On Modern Controls and Themes in Power Apps:

WhereSettingValue
Settings → Updates → NewModern controls and themesOn
Settings → GeneralEnable App.OnStart propertyOn (leave the default)
AppOnStartEmpty

In the example app, Modern controls and themes was Off. This series uses the modern Text, Avatar and Button controls, which follow the app's theme.

OnStart stays empty. The app works out its data with named formulas (Step 2) and chooses its first screen with StartScreen (Step 3). Studio itself warns that OnStart can cause delays when loading an app. What the Enable App.OnStart Property Setting Does explains why the switch can stay at its default.

The Updates page of Settings on the New tab, with the Modern controls and themes switch On, outlined in red

Step 2: Write the Named Formulas​

A named formula gives a name to a value that the whole app can use. Select App in the tree view and choose Formulas in the property list, as in How to Use Named Formulas in Power Apps. Build it up a few lines at a time.

The app's title​

App → Formulas
AppTitle = "Career Development Plan";

The header shows it in Step 5. If the app is renamed, this is the only place to change.

The signed-in person​

App → Formulas
MyProfile = Office365Users.MyProfileV2({'$select': "id,displayName,givenName,mail,userPrincipalName,jobTitle"});
MyJobTitle = Trim(MyProfile.jobTitle);
  • MyProfile is the person's Microsoft 365 profile. '$select' asks for the six fields the app uses, and any other field comes back blank. User() has the person's name, email and photo, but not their job title, so the app asks Office 365 Users.
  • MyJobTitle is the job title without stray spaces. Trim removes spaces at both ends and doubled spaces in between (How to Remove Extra Spaces in Power Apps with Trim and TrimEnds). The job title decides which competencies a person sees: Part 5 will match it against the JobTitle column, and a stray space would stop it matching.

Their manager​

App → Formulas
MyManager = IfError(
Office365Users.ManagerV2(
MyProfile.id,
{'$select': "id,displayName,mail,jobTitle"}
),
Blank()
);

ManagerV2 returns the person's manager (How to Get a User's Manager in Power Apps). For someone without a manager, such as the Managing Director, it fails with Resource 'manager' does not exist. IfError turns that failure into a blank (How to Handle Errors in Power Apps with IfError), and Step 7 shows a message in its place.

Their direct reports​

App → Formulas
MyDirectReports = Sort(
Filter(
Office365Users.DirectReportsV2(
MyProfile.id,
{'$select': "id,displayName,mail,userPrincipalName,jobTitle,accountEnabled"}
).value,
accountEnabled
),
displayName
);
IsManager = !IsEmpty(MyDirectReports);

Read MyDirectReports from the inside out:

  1. DirectReportsV2 returns the people who report to this person. The table is in its .value (How to Get a User's Direct Reports in Power Apps).
  2. Filter keeps only the accounts that are enabled (How to Filter a Table in Power Apps with Filter). When someone leaves and their sign-in is blocked, they drop off the list. Part 10 will test that.
  3. Sort puts them in name order (How to Sort a Table in Power Apps with Sort).

IsManager is true when that list has anyone in it. IsEmpty checks for an empty table, and ! turns its answer around (IsBlank vs IsEmpty in Power Apps, How to Use Not in Power Apps).

tip

Named formulas hold values only. A Set or Navigate in App.Formulas gives Behavior function in a non-behavior property.

The complete App.Formulas​

Here's the whole property. After pasting it, expand the formula bar and select Format text to lay it out like this:

A code window titled App → Formulas with the six named formulas: AppTitle, MyProfile from Office365Users.MyProfileV2 with a $select list, MyJobTitle trimmed from the profile, MyManager from ManagerV2 wrapped in IfError so it is blank when there is no manager, MyDirectReports filtered to enabled accounts and sorted by name, and IsManager true when there are direct reports

App → Formulas
AppTitle = "Career Development Plan";
MyProfile = Office365Users.MyProfileV2({'$select': "id,displayName,givenName,mail,userPrincipalName,jobTitle"});
MyJobTitle = Trim(MyProfile.jobTitle);
MyManager = IfError(
Office365Users.ManagerV2(
MyProfile.id,
{'$select': "id,displayName,mail,jobTitle"}
),
Blank()
);
MyDirectReports = Sort(
Filter(
Office365Users.DirectReportsV2(
MyProfile.id,
{'$select': "id,displayName,mail,userPrincipalName,jobTitle,accountEnabled"}
).value,
accountEnabled
),
displayName
);
IsManager = !IsEmpty(MyDirectReports);

Later parts add more named formulas as their screens need them.

To see the values, open Variables (the {x} icon on the left) and expand Named formulas:

The Variables pane with Named formulas listing AppTitle (Text), IsManager (Boolean: true), MyDirectReports (Table: 1 rows), MyJobTitle (Text: Managing Director), MyManager (Record: Blank) and MyProfile (Record)

For the admin, IsManager is true because Olivia reports to them, and MyManager is blank because the Managing Director has no manager.

Step 3: Rename the Screen and Set the Start Screen​

Follow How to Rename a Screen or Control in Power Apps and How to Set the Start Screen in Power Apps with App.StartScreen:

ItemValue
Screen1Rename to Home Screen
App → StartScreen'Home Screen'

Names in this series follow Power Apps Naming Conventions for Screens, Controls and Formulas. Screens are named in words ending in Screen. Each control starts with a short prefix for its type and ends with the code of its screen, HS for Home Screen. Later screens can then have their own title label without a clash.

PrefixControl type
conContainer
lblText or Text label
avtAvatar
btnButton

StartScreen makes the first screen a deliberate choice. Without it, the app opens on whichever screen is first in the tree view.

The formula bar with the StartScreen property of App set to 'Home Screen', and the Home Screen outlined in green on the canvas

Step 4: Add the Screen Container​

Containers arrange the controls inside them and resize with the window, which is what makes the screen fit a phone. This is the structure that Steps 4 to 8 build:

Home Screen layout
Home Screen
└─ conMainHS vertical: fills the screen
├─ conHeaderHS horizontal: the header
│ └─ lblTitleHS the app's name, the screen's main heading
└─ conBodyHS vertical: everything below the header
├─ conProfileHS horizontal: the profile row
│ ├─ avtMeHS photo or initials
│ └─ conProfileTextHS vertical: three lines of text
│ ├─ lblWelcomeHS
│ ├─ lblJobTitleHS
│ └─ lblManagerHS
└─ conActionsHS horizontal: the buttons
├─ btnMyPlanHS
└─ btnMyTeamHS

Follow How to Add a Vertical Container in Power Apps. With Home Screen selected, insert Layout → Vertical container, rename it conMainHS, and set:

PropertyValue
X, Y0, 0
WidthParent.Width
HeightParent.Height
Align (horizontal)Stretch
Padding0 on all four sides
Drop shadowNone
Border radius0 on all four corners

Parent.Width and Parent.Height make the container as big as the screen, whatever size the screen is. Stretch makes everything inside it as wide as the container.

The formula bar with Height set to Parent.Height, the preview strip reading Parent.Height = 768 with Data type number, and the container filling the whole screen on the canvas, 1366 by 768 in the properties pane

Step 5: Add the Header and Its Heading​

Follow How to Add a Horizontal Container in Power Apps. Select conMainHS, insert Layout → Horizontal container, and rename it conHeaderHS:

PropertyValue
Flexible heightOff
Height64
FillApp.Theme.Colors.Primary
PaddingLeft and right 24, top and bottom 0
Drop shadowNone
Border radius0

App.Theme.Colors.Primary is the main color of the app's theme (How to Use Theme Colors and Fonts in Power Apps Formulas), so the header follows the theme you choose in Step 9.

Inside conHeaderHS, insert Classic → Text label and rename it lblTitleHS. It's a classic control on purpose: only the classic label has a Role, which tells screen readers that this is the screen's main heading (How to Add a Heading for Screen Readers in Power Apps).

PropertyValue
TextAppTitle
RoleTextRole.Heading1
ColorColor.White
FontApp.Theme.Font
Size20
FontWeightFontWeight.Semibold
Flexible widthOn, fill portions 1
Height40
PaddingLeft0

Set Role in the formula bar, because it isn't on the label's Display tab. The header now shows the app's name, still in the blue of the default Power Apps theme:

The formula bar with the Text property of lblTitleHS set to AppTitle, the preview strip reading AppTitle = Career Development Plan, and a blue header across the top of the screen with the white title Career Development Plan

Step 6: Add the Profile Row and the Avatar​

Select conMainHS again and insert a Vertical container for the rest of the screen. Rename it conBodyHS:

PropertyValue
Flexible heightOn (the default), so it fills the space below the header
Align (horizontal)Stretch
Gap16
Padding24 on all four sides
Vertical overflowScroll
Drop shadowNone
Border radius0

Scroll lets the body scroll when it doesn't fit, instead of hiding what's at the bottom.

Inside conBodyHS, insert a Horizontal container for the profile row, conProfileHS:

PropertyValue
Flexible heightOff
Height120 for now; Step 10 replaces it with a formula
Gap16
Align (vertical)Center
Padding0
Drop shadowNone
Border radius0

Inside conProfileHS, insert Display → Avatar and rename it avtMeHS (How to Add an Avatar Control in Power Apps):

PropertyValue
ImageIf(Office365Users.UserPhotoMetadata(User().Email).HasPhoto, User().Image)
NameUser().FullName (the default)
BadgeBlank()
Width, Height72, 72

With the default Image, User().Image, someone without a photo gets a grey person icon instead of their initials. The formula uses the photo only when there is one. Badge starts as a fixed Available dot that says nothing about the person's real status, so it's removed.

Last, select conProfileHS and insert a Vertical container, conProfileTextHS, for the three lines of text next to the avatar:

PropertyValue
Flexible widthOn, fill portions 1
Gap4
Align (horizontal)Stretch
Justify (vertical)Center
Align in containerStretch
Padding0
Drop shadowNone
Border radius0

The profile row now shows the admin's initials, AU, in the theme's color:

The formula bar with the avatar's Image formula using UserPhotoMetadata HasPhoto, and below the blue header the profile row with the initials AU in a blue circle

Step 7: Add the Welcome, Job Title and Manager​

Select conProfileTextHS and insert Display → Text three times (How to Add a Text Control in Power Apps). Rename them lblWelcomeHS, lblJobTitleHS and lblManagerHS, and turn Auto height on for all three, so each one grows when its text wraps.

The welcome:

lblWelcomeHS → Text
"Welcome, " & Coalesce(MyProfile.givenName, MyProfile.displayName)

& joins pieces of text (How to Join Text in Power Apps with & and String Interpolation). Coalesce returns the first value that isn't blank (How to Replace Blank Values in Power Apps with Coalesce): the first name, or the full display name for a profile without one. Set Size to 24 and FontWeight to FontWeight.Semibold.

The job title and the manager:

lblJobTitleHS → Text
If(
IsBlank(MyJobTitle),
"Your Microsoft 365 profile has no job title, so there's no plan to show yet. Ask your IT admin to add one.",
"Job title: " & MyJobTitle
)
lblManagerHS → Text
If(
IsBlank(MyManager),
"Your Microsoft 365 profile has no manager, so nobody can review your responses yet. Ask your IT admin to add one.",
"Manager: " & MyManager.displayName
)

If picks one of two texts (How to Use the If Function in Power Apps), and IsBlank checks for a missing value. Instead of an empty line, people see what's missing and who can fix it: a plan needs a job title, and a review needs a manager. For the admin, the manager line shows the message:

The formula bar with the If formula for the manager and the preview strip showing the no-manager message; on the canvas, Welcome, Admin in large semibold text, Job title: Managing Director, and the message, next to the AU avatar

Step 8: Add the My Plan and My Team Buttons​

Select conBodyHS and insert a Horizontal container, conActionsHS, below the profile row:

PropertyValue
Flexible heightOff
Height48
Gap16
Align (vertical)Center
Padding0
Drop shadowNone
Border radius0

Inside it, insert Input → Button and rename it btnMyPlanHS (How to Add a Button in Power Apps). Then, with btnMyPlanHS selected, insert a second Button: it goes into the same container, next to the first. Rename it btnMyTeamHS.

PropertybtnMyPlanHSbtnMyTeamHS
Text"My plan""My team"
Icon"DocumentBulletList""People"
AppearancePrimary (the default)ButtonAppearance.Secondary
Width, Height160, 40160, 40
Visibletrue (the default)IsManager

The icons come from the button's icon list (How to Add an Icon to a Button in Power Apps). My team is visible only when IsManager is true (How to Show or Hide a Control in Power Apps with Visible), so people without direct reports never see it. OnSelect stays false on both for now: Part 5 connects My plan, and Part 7 My team.

Both buttons show for the admin, because IsManager is true:

The formula bar with the Visible property of btnMyTeamHS set to IsManager and the preview strip reading IsManager = true; on the canvas, the filled My plan button and the outlined My team button below the profile row

note

Part 9 adjusts this screen for the narrowest phones, 360 pixels wide: the title's Size becomes If(App.ActiveScreen.Size = ScreenSize.Small, 18, 20), and both buttons' Width becomes If(App.ActiveScreen.Size = ScreenSize.Small, (Parent.Width - Parent.LayoutGap) / 2, 160), so they share the row (Fixed: Text and Buttons Cut Off on Narrow Phones).

Step 9: Apply the Steel Theme​

Follow How to Apply a Modern Theme in Power Apps: open More (…) on the left, then Themes. Before, the screen is in the default Power Apps theme:

The Themes pane with eight themes and Power Apps selected, next to the Home screen in blue: a blue header, a blue avatar with initials and a blue My plan button

Select Steel. When Studio asks whether to Apply to classic controls, select Cancel: the only classic control, lblTitleHS, already takes its color and font from Step 5. The header, the avatar and the My plan button change together, because their colors come from the theme:

The Home screen in the Steel theme: a teal header with the white title Career Development Plan, a teal avatar and a teal My plan button, with Steel outlined in the Themes pane

App.Theme is now SteelTheme. Steel is the example's choice; any theme works the same way.

Step 10: Test the Screen at a Phone Size​

Preview the app with F5 (How to Preview a Canvas App in Power Apps Studio) and choose Phones → Apple iPhone 12, 13, 14 (How to Test a Power Apps Canvas App on Phone and Tablet Sizes). In the example, the profile row was cut off:

The Home screen in a phone frame: the welcome line half hidden at the top of the profile area, and the manager message cut off after the words Ask your IT admin to

On the narrow screen the text wraps onto more lines, and the Text controls grow, but conProfileHS stays 120 high and clips them (Fixed: Text Is Cut Off Inside a Container on Small Screens). Close the preview with Esc and give conProfileHS a Height that follows its content:

conProfileHS → Height
Max(
avtMeHS.Height,
lblWelcomeHS.Height + lblJobTitleHS.Height + lblManagerHS.Height + 2 * conProfileTextHS.LayoutGap
)

Max returns the larger of two numbers (How to Get the Largest Value in Power Apps with Max): the avatar's height, or the text column's height, which is the three Text controls plus the two gaps between them. At the default canvas size it comes to 114. On a phone, it grows with the text:

The Home screen in the iPhone 12, 13, 14 frame with the full welcome line, the job title, the whole manager message across four lines, and the My plan and My team buttons below

Back in Studio, the Small size at the bottom of the canvas, 600 pixels wide, shows the same:

The Home screen on the canvas at the Small size, 600 wide, with the manager message on two lines, the buttons below, and the Small button highlighted in the bottom bar

Step 11: Give Every Control an Accessible Label​

Open the App checker, the stethoscope icon on the right edge of Studio, and select Accessibility. It lists six Missing accessible label errors:

The Accessibility pane of the App checker with Errors (6), expanded to Missing accessible label (6) with avtMeHS, lblWelcomeHS, lblJobTitleHS, lblManagerHS, btnMyPlanHS and btnMyTeamHS

Set AccessibleLabel on each control. Fixed: "Missing Accessible Label" explains each choice:

ControlAccessibleLabel
avtMeHS"Profile picture of " & User().FullName
lblWelcomeHS, lblJobTitleHS, lblManagerHSSelf.Text
btnMyPlanHS"My plan: the competencies for your job title"
btnMyTeamHS"My team: your direct reports and their responses"

Select Recheck all. Accessibility no longer shows a count:

The App checker pane with Recheck all and the categories Formulas, Runtime, Accessibility, Performance and Data source (2), with no count next to Accessibility

Data source (2) is expected. It warns that RoleCompetencies and CompetencyResponses aren't used yet (Fixed: "Unused Data Sources"):

The Details pane for Unused data sources: This data source is not used in the app. Removing it will improve performance, the location CompetencyResponses, and How to fix: Remove this data source using the Data panel

Don't remove them, whatever the advice says: Part 5 uses both lists, and the warning clears.

Step 12: Save the App​

Select Save. Don't publish yet: Part 7 publishes the app and shares it with the team.

Here's the finished Home screen on the canvas:

The finished Home screen on the Studio canvas in the Steel theme: a teal header reading Career Development Plan, the AU avatar, Welcome, Admin, Job title: Managing Director, the no-manager message, and the My plan and My team buttons

And its controls in the tree view, matching the layout from Step 4:

The tree view of the Home Screen: conMainHS containing conHeaderHS with lblTitleHS, and conBodyHS with conProfileHS (avtMeHS and conProfileTextHS with lblWelcomeHS, lblJobTitleHS and lblManagerHS) and conActionsHS with btnMyPlanHS and btnMyTeamHS

Common Mistakes​

MistakeWhat happensDo this instead
Inserting a control while another control is selectedIt lands in that control's container, such as the headerSelect the container you want first
Leaving out jobTitle from '$select'MyJobTitle is blank, and everyone sees the "no job title" messageKeep all six fields in MyProfile
Leaving Image at User().ImagePeople without a photo get a grey icon instead of initialsUse the HasPhoto formula
Leaving conProfileHS at a fixed heightText is cut off on phonesUse the Max formula from Step 10
Selecting Enable in Apply to classic controlsThe title's color and font formulas are replacedSelect Cancel
Removing the unused data sourcesPart 5 has no lists to readKeep them

Troubleshooting​

SymptomLikely causeFix
A red banner: Office365Users.ManagerV2 failedManagerV2 without IfError, for someone with no managerFixed: Resource 'manager' Does Not Exist
Behavior function in a non-behavior property in App.FormulasA Set or Navigate in a named formulaFixed: Behavior Function in a Non-Behavior Property
A grey person icon instead of initialsImage is User().ImageFixed: Avatar Shows a Grey Person Icon
Text cut off on a phoneconProfileHS has a fixed heightFixed: Text Is Cut Off Inside a Container
Missing accessible label in the App checkerAccessibleLabel is emptyFixed: "Missing Accessible Label"
Studio opens (Read-only)Another session of yours holds the app, for example after a page reloadFixed: "This App Is Read-Only…"
My team missing for a managerIsManager is falseCheck MyDirectReports in Variables, and that their reports' accounts are enabled

FAQ​

Why named formulas and not OnStart?​

A named formula is always up to date, can't be overwritten by accident, and is worked out only when something needs it. How to Use Named Formulas in Power Apps compares the two.

Why does the admin see "no manager"?​

In the demo organization, the admin is the Managing Director, at the top, so Microsoft 365 has no manager for them. Olivia and the others do, and later parts run the app as them.

What do the buttons do?​

Nothing yet. Part 5 makes My plan open the My Plan screen, and Part 7 connects My team.

Why is the title a classic control when everything else is modern?​

Because Role, which marks it as the screen's main heading for screen readers, is only on the classic Text label.

Will the screen work on a phone?​

Yes. The app's layout is Responsive (Part 3), the containers resize with the window, and Step 10 checked it at an iPhone size.

Conclusion​

The app now has its first screen. Home Screen is the start screen, and App.Formulas holds six named formulas: AppTitle, MyProfile, MyJobTitle, MyManager, MyDirectReports and IsManager. The screen:

  • greets the signed-in person by name, with their photo or initials;
  • shows their job title and manager, or says what's missing and who can fix it;
  • offers My plan to everyone and My team only to managers;
  • fits a phone, follows the Steel theme, and has an accessible label on every control.

← Previous: Part 3: Create the Solution, Environment Variables and Canvas App

Next → Part 5: Build the My Plan Screen. You'll list the competencies for your job title from RoleCompetencies, show where each one stands, and connect the My plan button.

Additional Resources​

Stay Updated

Subscribe to our newsletter for the latest tutorials, tech insights, and developer news.

By subscribing, you agree to our privacy policy. Unsubscribe at any time.