COVID-19 is changing how employers maintain workplace safety. As workplaces continue to slowly reopen, companies need solutions in place to ensure the safety of their employees.
One strategy, recommended by the Centers for Disease Control and Prevention (CDC) and the Occupational Safety and Health Administration (OSHA) for employers, is to mandate a daily health check of their employees prior to entry into the workplace.
We thought that a COVID daily health check quiz was a perfect opportunity to explore with Microsoft Power Apps.
Easily Create and Update Power Apps Quizzes
A really brief digression into Power Apps, in case you are unfamiliar. Power Apps is Microsoft’s entry point into the world of low-code development platforms. It’s software designed for “citizen” developers to help them quickly and seamlessly create business web and mobile applications that fit specific business needs.
CDC and OSHA have provided a list of recommended questions. Leveraging this list, we created a COVID daily health check quiz. We put together 11 sample questions matching some of the CDC and OSHA recommendations and adding some of our own.
Using the built-in functionality between SharePoint and Power Apps will keep the sensitive employee health information confidential. Power Apps will also offer a simple survey template for employees without having this feel like “one more thing” to complete. Here is Microsoft documentation for creating a canvas app from a SharePoint list.
Because Power Apps is “citizen developer-friendly,” this form and these questions can be easily updated as the CDC, OSHA, and state health departments information and standards change.
How to Build a Power Apps COVID Quiz
Here are some of the key steps we took to build the COVID daily health check quiz using SharePoint lists and Power Apps. And, we built the whole questionnaire in less than an hour.
Create a SharePoint list of requirement questions (COVID19Questions). When adding columns, make sure to select the appropriate column type. For example, UserID will be a ”single line of text” to correctly store the user ID data. The date will be “Date and Time” and the questions will be stored as “Yes/No.”
A separate SharePoint List (COVID19Locations) with work locations was created. In the original SharePoint requirement questions list, the work location data type was set to “lookup” with the “get information from” set to the COVID19Locations location column. This will limit the users choices to the COVID19Location items.
As seen in step 1, the three employee attestation columns were set to “choice” data type. The choices are then added as necessary in the “Type each choice on a separate line” dialog box.
In SharePoint Online, open the custom list, select PowerApps on the command bar, then select Create an app.
A new tab appears in your web browser that shows the default canvas app based on your SharePoint list. The app appears in PowerApps Studio, to be further customized.
The edit screen was copied to four individual screens to effectively display the 11 questions. The edit form field control type was changed to “edit options” with the default value set to “blank()” to require the user to make a choice. Here is the first question screen:
A welcome screen was created to improve the flow of the questionnaire. This welcomes the user and validates the user is logged in correctly.
To validate, all questions were answered before a user could move to the next question screen. The continue button “visible” property was edited with an “if” function, checking for blanks. Here is the example function from the first question screen:
If(DataCardValue11.Selected.Value<>Blank() And DataCardValue12.Selected.Value<>Blank() And DataCardValue13.Selected.Value<>Blank() And DataCardValue14.Selected.Value<>Blank(), true , false )
Two separate functions were used on the continue button on the final question screen. Firstly, a “patch” function was used to dump the answers into one row on the SharePoint list:
Secondly an “if” function was used to navigate between appropriate screens based on the selected values:
If(DataCardValue11.Selected.Value=”Yes” Or DataCardValue12.Selected.Value=”Yes” Or DataCardValue13.Selected.Value=”Yes” Or DataCardValue14.Selected.Value=”Yes” Or DataCardValue21.Selected.Value=”Yes” Or DataCardValue22.Selected.Value=”Yes” Or DataCardValue23.Selected.Value=”Yes”,Navigate(scrError),Navigate(scrCompletion))
These two functions can be chained using a semicolon “;” as shown below:
As shown in the “if” function above from the final question screen, if any of the questions were answered “yes”—which would flag a health concern—the user would be directed to the “error screen” to be further directed to not enter the worksite and to contact the appropriate supervisor. If the user completed the questionnaire with no red flags, they are directed to the “completion screen.”
This Power Apps quiz is just one example of how a new business requirement can be quickly turned into a production-ready solution that will run seamlessly in your browser or on mobile devices before lunch.
In this example, business data was stored in SharePoint. However, the data can be stored in the underlying data platform (Common Data Service) or in various on-premise data sources (Excel, Office 365, Dynamics 365, SQL Server, etc.). Many variations can be taken to streamline and modify apps for your specific needs.
If you have further questions regarding Microsoft Power Platform and potential applications, please reach out to us here at SkyPoint CSG.