Microsoft provided industry solutions help organizations quickly and confidently deploy and manage tools and services across a wide range of vertical sectors. Some solutions span across verticals, helping these organizations with routine, or in the case of this article, not so routine concerns.

This article will focus on supporting and extending the Return to Workplace solution. This work comes from hands on experience assisting and overcoming customers' challenges and specific business needs. In it, I'd like to cover some of the terminology used and where and how to find out how the app works. Once we know where to look, I'll provide a solution to extend the app.

The primary audience is people who are interested in getting started with extending solutions. If you have extensive experience with the platform, you may skip to the support or extend section.

The Story


In this scenario, our organization, Contoso Coffee, has multiple corporate buildings and franchises across the globe. They have decided to use the Facility Management App to help employees return to work safely. The initial solution setup works great, and internally Contoso Coffee is testing the app before rolling out to its employees. After demonstrating the app to a pilot group and other key stakeholders, questions start to arise. For instance, the app is designed to allow employees access for today but what about when access is needed a week from now due to booking specialized guests weeks ahead of time?

The Facility Management App


Before jumping into supporting and extending, if you're interested in learning more about the Facility Management app, review this article.

"The Return to the Workplace solution supports an organization's goal to return to normal and reopen its facilities to its employees as safely and quickly as possible. As a facility manager, you can use the Facility Safety Management app to manage and support your organization's journey through its specific reopening plan for your facility and its associated phases and goals."



Some of the terminology used I encountered included both solution areas (Facilities, Employee Bookings, Attestations, etc) and components (front end, back end, etc.). Depending on what area of the solution discussed we can attempt to understand what components maybe used. When I hear employee bookings concerns I first begin to ask if this is impacting the front end or back end.

The Employee Return to Workplace App and Portal


The Employee Return to Workplace App may be called various names by users. Terms such as "mobile app", "front end app", "portal" "booking app", etc could all be used. Typically if the ask is coming from users or the user perspective its referring to the Power App Canvas App or Portal App. If you have trouble distinguishing, ask the user to take a screenshot of what they are seeing.

The Facility Safety Management App


The Facility Safety Management App can also go by different names. Typically this app will be used by managers and administrators who are working on the reopening plan for each facility. Terms I've heard used are "back end", "booking database", "model app", etc.

Cloud Flows


The Return to Workplace solution relies on Power Automate Cloud Flows to assist with implementing various aspects of business logic. This article lists the flows used by the app. As the article also describes these can be turned on and off depending on what's needed by your business requirements. Before turning a cloud flow off, review what's happening within to not disable or disrupt the user's experience.

Real time and Background Business Logic


Here's where it begins to get tricky. Business logic can happen in multiple components, the apps, the portal or cloud flows. Some actions that seem that they would come from the Return to Workplace app actually happen within a Power Automate cloud flow. Conversely, an update or booking could come directly from the app or apps themselves. Even better, this action and the corresponding logic could be happening in multiple places!

An example, would be the employee booking process. When an employee places a booking request for a facility area they are interacting with the app. When the employee presses the confirm button, the app is creating a row in the Facility Safety Management App. When the row is created, a Power Automate cloud flow is triggered which creates or updates the daily occupancy for that facility area.

When supporting the solution, one of the first things I look to understand is if the action taking place seems to be happening in real time or not. This means, if I press a button on the front end app, do I see a booking immediately in the back end? If so, that could be called real time and would help troubleshoot where the logic resides. If I press the same button but don't necessarily see something happening but within the back end app but I do see changes to the front end, I consider that a background action.

In the context of this solution, generally if you see something happening in the background, check the Power Automate cloud flows. If you're still searching, look at the processes within the backend app. Typically, for cloud flows, you will see a trigger action from Microsoft Dataverse. Below is an example of the 'Employee Booking - Update Daily Occupancy''.

In the image above, the trigger shows when a record is created or updated that it will perform the actions below. If updates are happening to records within the back end, look for other Dataverse connector actions, such as the 'Create Daily Occupancy' action.

NOTE: Cloud Flows can be used as real time integrations, just not in this solution as its presented. To add a cloud flow to be triggered directly from the front end app, look into this article, detailing how to setup a Power App initiated flow.

Supporting the Return to Workplace App


Supporting the Return to Workplace solution requires basic understanding of the terminology above, the syntax of Power Apps Canvas Apps, Power Automate concepts, the Common Data Model, licensing and permissions and how to work with Model App customizations. Depending on which features are enabled, this could also include Microsoft Power BI. This article's focus is on supporting the customizations specific to understanding where changes maybe failing, how to find them and options to resolve.

Return to Workplace App


Working with the Return to Workplace App, when a user is reporting something isn't working correctly I tend to group into two categories: Does it seem like the app is working but data is not reflecting or is the app itself encountering issues.

If the app is encountering issues, users may report notifications of errors happening, controls not rendering, navigation and transitions not taking place. If notifications are reporting errors, this could be due to a connector not able to work with data or a formula that isn't working as expected. If possible, have the user open the Return to Workplace app with the Monitor Tool as shown below:

For more information on how to work with the tool directly, please refer to Monitoring the Power Platform: Canvas Apps - The Monitoring Tool - Microsoft Dynamics CRM Community or Canvas app debugging with Monitor - Power Apps | Microsoft Docs

If you run this tool and encounter an issue with a formula, most likely you'll have to edit the Return to Workplace app and modify and test changes. Within the editor, in the lower left corner is a button showing a set of tools. When expanded you'll find the Monitor tool which can help when testing and debugging. If a red error circle shows up when you open a screen, most likely there is an issue within the OnVisible property of the screen. This property is designed to run code when a page or screen is displayed.

To navigate to the code that is run when the screen is displayed, open the property bar on the top left and find OnVisible.

When making changes to formulas, look for the red line when you expand the formula bar. If you see the red line within functions or words such as Set or ClearCollect, this could mean an issue with a connector, for instance to the back end app.

Review the output for the Monitor Tool for help on the request being made to the connector. For the Return to Workplace app, most requests can be pulled directly from the Monitor Tool output and replayed within a browser window.

Another technique I recommend when troubleshooting is to use the Notify method to help display information that is passed across screens or used in a button press.

The Notify method is also a great way to help instruct users if they maybe doing something incorrectly. As shown in the example below, I am not setting the correct date and time to move forward.

Finally, when editing and debugging, try to avoid publishing your changes until you are confident the modifications are working as expected.

Extending the Return to Workplace App


In the story I worked on, we had to add and change the navigation of the front end app to allow for booking at a later time. We also had requirements regarding when employees could enter and leave the building, how many could overlap and so on. If you are asked to start adding your specific requirements to the Return to Workplace solution, I highly recommend first reviewing all of the Extend the Return to the Workplace solution article.

This article provides an Entity Relationship Diagram, tips on security, how to copy the canvas app, and the definition and descriptions of all of the components of the app. For the most part if you can't find what you're looking for here, review again or focus on the Use the solution section of the documentation.

Updating the Common Data Model


To add new fields to a table, such as Daily Occupancy, or to modify Power Automate flows work with the Maker portal to build a solution that can house changes to the module you're building.

Here is an image showing the work done for future bookings.

Updating Real Time Business Logic


If you need to update the logic, for instance add new fields when creating a booking from the front end, look for the control that would be used to create the booking. For instance, in the Return to Workplace app, the Statements screen contains a button called "I Agree" that when clicked creates a booking.

In this example below, we have extended the patch or update of the employee booking record to include arrival time start and end dates. We enclosed this update within some basic error handling which will notify the user if there is any issue.

This is an example of modifying the real time logic of the Return to Workplace app for the front end. If you are asked to update for not only the front end but the back end as well, you may need to refer to Model App development techniques such as processes or plugins. If so, refer the article Use plug-ins to extend business processes.

Updating Background Business Logic


If the business ask doesn't require real time changes, consider using Microsoft Power Automate flows to handle the logic. The Return to Workplace solution contains multiple flows designed to work with the system to update and perform actions on behalf of employees behind the scenes. When updating an action within a flow, be sure to reference the correct previous action. In the example below, I am updating the 'Create Daily Occupancy' action in the 'Employee Booking - Update Daily Occupancy' cloud flow.

As you can see, when I click on a field, a window pops up allowing me to pick various fields from previous actions performed. In this example, I want to take the starting arrival time of the booking, so I am looking for the 'When a record is created, updated, or deleted' group containing the 'Start Arrival Time' field. You may see multiple 'Start Arrival Time' fields so be mindful of the group it resides in.

Next Steps


This article should help you get started working with the Return to Workplace solution. When supporting, be sure to use tools such as the Monitor tool and Power Apps Checker that are native to the platform that can help troubleshoot in real time. When extending, the Return to Workplace documentation is a great reference to help you get started.

Finally, check out this short video where I demonstrate and walk through some of the content presented above.

For more information or guidance on supporting or extending the solution, please reach out to me or your Microsoft representative.