Power Apps

COVID19 Building Access App: Per Space Approval

This week I’ll start a series on incorporating changes into the COVID19 Building Access App. The first post will show how to change the 1.1 version to include per space approval.

By default the Building Access App includes an approval process that can be automatic, based on the manager configured on Active Directory or through a post into a specific Teams channel with adaptive cards for those users that don’t have a manager configured.

The number one request I get from customers deploying the app for the back to office scenario is to have the ability to have specific users responsible for specific spaces.

The following instructions can be used to learn about the application, power apps or even to incorporate the feature in your implementation. Please be aware that those changes only work in the 1.1 version of the app.

If you don’t want to follow the steps to change your setup and just need the feature in your environment, I published a new package on GitHub with the required changes already incorporated into the 1.1 package. I versioned it as 1.11.  

https://github.com/cristianoag/BuildingAccess/releases/tag/1.11

20200811_113400000_iOS20200811_113313000_iOS20200811_113304000_iOS20200811_113320000_iOS20200811_113335000_iOS

Here are the changes that need to be implemented.

SharePoint Online

The first step consists on the creation of two additional columns on the BAR_Spaces SharePoint list to store space approvers and the flag to override the default approval flow.

  • Open SharePoint Online as administrator. Open the SPO site being used to store data for the BAR application.
  • Create an additional column of type person (Approver) in the BAR_Spaces SharePoint list.
  • Create an additional column of type Yes/No (HasApprover) in the BAR_Spaces SharePoint list. Select the default value No.

Building Admin

Now you need to update the Building Admin app to incorporate changes into the spaces detail form as well as in the gallery used to present spaces for configuration.

  • Open PowerApps as admin and edit the Building Admin app.
  • Go to Data and refresh the BAR_Spaces connection.
  • Go to Tree view and expand the Screen Space Detail page, click FormEditSpace, select Edit Fields and include the Approver and HasApprover additional fields. Change properties as required.
  • Select the DataCardValue in HasApprover (switch) and update the OnCheck event with:
Set(b_hasapprover,true);
  • Select the DataCardValue in HasApprover (switch) and update the OnUncheck event with:
Set(b_hasapprover,false);
  • Select the Approver Datacard and replace the value for Visible by b_hasapprover
  • Go to Tree view and expand the Screen Spaces page.
  • Edit GallerySpaces and include an additional label with the text “Approver:”. Make the font weight Samibold on properties.
  • Still on GallerySpaces, include an additional label connecting Text to the following formula:
If(ThisItem.HasApprover,ThisItem.Approver.DisplayName,”Default”)
  • Save and publish the app.

Building Access

The main app needs to be changed to pass the appropriate parameters to the request creation flow.

  • Open PowerApps as admin and edit the Building Access app.
  • Go to Data and refresh the BAR_Spaces connection.
  • Go to Tree view and expand Screen Availability. Expand GallerySpace and select imgAddRequest_1.
  • In the Action pane, go to OnSelect and change the content to include two additional parameters to the colChosenRequests collection. The content needs to be changed.
From this:

Collect(colChosenRequests,{FloorID:ThisItem.ID,BuldingID:ThisItem.BuildingID,DateValue:varSelectedDateString ,FloorTitle:ThisItem.Title,DatePickerValue: DatePicker.SelectedDate,BuldingName:varSelectedBuilding.Title, FloorName:ThisItem.Title,BuildingMaxOccupancy:Value( varSelectedBuilding.MaxOccupancy) ,RequestorName:varUser.displayName,RequestorEmail:varUser.mail,

OverCapacity:If( (CountRows( colDateRequests) >=varSelectedBuilding.MaxOccupancy) || varSelectedBuilding.MaxOccupancy = 0,true,false)

}) ;

UpdateContext({btnAddRequestInfoVisible:true});

//Notify(varString.RequestAddedPopupMsg,NotificationType.Success,3000)

To this:

Collect(colChosenRequests,{FloorID:ThisItem.ID,BuldingID:ThisItem.BuildingID,DateValue:varSelectedDateString ,FloorTitle:ThisItem.Title,

FloorApproverEmail: ThisItem.Approver.Email,

FloorHasApprover: ThisItem.HasApprover,

DatePickerValue: DatePicker.SelectedDate,BuldingName:varSelectedBuilding.Title, FloorName:ThisItem.Title,BuildingMaxOccupancy:Value( varSelectedBuilding.MaxOccupancy) ,RequestorName:varUser.displayName,RequestorEmail:varUser.mail,

OverCapacity:If( (CountRows( colDateRequests) >=varSelectedBuilding.MaxOccupancy) || varSelectedBuilding.MaxOccupancy = 0,true,false)

}) ;

UpdateContext({btnAddRequestInfoVisible:true});

//Notify(varString.RequestAddedPopupMsg,NotificationType.Success,3000)

  • Save and publish the app.

BARCreateRequests Flow

The BARCreateRequests flow needs to be changed to update the appropriate parameters in the request.

  • Open Power Automate as admin, click My Flows and edit the BARCreateRequests flow.
  • Expand InputRequests and change the schema to include FloorApprover (string) and FloorHasApprover (boolean) input parameters.

From:

{

“type”: “array”,

“items”: {

“type”: “object”,

“properties”: {

“BuildingMaxOccupancy”: {

“type”: “number”

            },

“BuldingID”: {

“type”: “integer”

            },

“BuldingName”: {

“type”: “string”

            },

“DatePickerValue”: {

“type”: “string”

            },

“DateValue”: {

“type”: “integer”

            },

“FloorID”: {

“type”: “integer”

            },

“FloorName”: {

“type”: “string”

            },

“FloorTitle”: {

“type”: “string”

            },

“OverCapacity”: {

“type”: “boolean”

            },

“RequestorEmail”: {

“type”: “string”

            },

“RequestorName”: {

“type”: “string”

            }

        },

“required”: [

“BuildingMaxOccupancy”,

“BuldingID”,

“BuldingName”,

“DatePickerValue”,

“DateValue”,

“FloorID”,

“FloorName”,

“FloorTitle”,

“OverCapacity”,

“RequestorEmail”,

“RequestorName”

        ]

    }

}

To:

{

“type”: “array”,

“items”: {

“type”: “object”,

“properties”: {

“BuildingMaxOccupancy”: {

“type”: “number”

            },

“BuldingID”: {

“type”: “integer”

            },

“BuldingName”: {

“type”: “string”

            },

“DatePickerValue”: {

“type”: “string”

            },

“DateValue”: {

“type”: “integer”

            },

“FloorID”: {

“type”: “integer”

            },

“FloorName”: {

“type”: “string”

            },

“FloorTitle”: {

“type”: “string”

            },

“FloorApproverEmail”: {

“type”: [“string”, “null”]

            },

“FloorHasApprover”: {

“type”: “boolean”

            },

“OverCapacity”: {

“type”: “boolean”

            },

“RequestorEmail”: {

“type”: “string”

            },

“RequestorName”: {

“type”: “string”

            }

        },

“required”: [

“BuildingMaxOccupancy”,

“BuldingID”,

“BuldingName”,

“DatePickerValue”,

“DateValue”,

“FloorID”,

“FloorName”,

“FloorTitle”,

“FloorHasApprover”,

“OverCapacity”,

“RequestorEmail”,

“RequestorName”

        ]

    }

}

  • Expand Scope-CreateRequest. Expand ForEachRequests and create a Get User Profile step just before the CreateRequests step. Use the formula below for the UPN value.

if(items(‘ForEachRequests’)[‘FloorHasApprover’],items(‘ForEachRequests’)[‘FloorApproverEmail’], if(variables(‘varManagerExists’),body(‘Get_manager_(V2)’)?[‘mail’], variables(‘UserEmail’)))

  • Expand CreateRequests. Update the formula for ApproverNameText to:

if(items(‘ForEachRequests’)[‘FloorHasApprover’],body(‘Get_Space_Approver_Profile’)?[‘displayName’],

if(equals(variables(‘varManagerExists’),true),body(‘Get_manager_(V2)’)?[‘displayName’],”))

  • Update the formula for ApproverGuid to:

if(items(‘ForEachRequests’)[‘FloorHasApprover’],body(‘Get_Space_Approver_Profile’)?[‘id’],

if(equals(variables(‘varManagerExists’),true),body(‘Get_manager_(V2)’)?[‘id’],”))

  • In Approver, Update the formula for Claims to:

if(items(‘ForEachRequests’)[‘FloorHasApprover’],items(‘ForEachRequests’)[‘FloorApproverEmail’], if(equals(variables(‘varManagerExists’),true),body(‘Get_manager_(V2)’)?[‘mail’],null))

  • Save the flow and test the application. It should be able to deal with all approval cases, including approval per space.

Dealing with Languages in the Back to Office App

Last week I published about the Back to Office (Building Access) app and the response was AMAZING! This blog had visits from almost 12,000 unique users from 65 countries in a span of 5 days. I couldn’t believe that! Thank you so much.

Since then I’ve been busy supporting dozens of customers with the tool setup and supporting our internal teams to better understand Teams as a platform and how leverage the application for the complex moment we live.

The setup is super easy and lasts less than a hour. The package shared on GitHub has detailed instructions on how to run the configuration flows and import the apps into your environment. 

As I deal with non-English speakers most of the time, there are a few things I would like to document to help others.


“The exhibition mode is invalid” error when running the DeploySPLists flow

You just ran the initial configuration flow (DeploySPLists) and got a error saying something like “the exhibition mode is invalid”. You may get the error message in your native language.

clip_image001

(more…)

COVID19 – Back to Office App

During the last three weeks I had the chance to see an idea become reality in a super short time.

When I started in my current team, my colleagues were just starting to think about scenarios that could be useful for our customers in our new reality and that could show the power of Microsoft 365 platform. No additional licenses, no upselling, just how to leverage Microsoft platform for a real urgent need.

Europe was facing the peak of the COVID-19 crisis, but seeing light. Customers started to think on how they could perform soft openings and welcome employees back to their offices in a responsible way.

The new reality would require reduction in occupancy, social distancing, extra protection and processes to ensure controlled access to buildings and spaces dedicated to work.

The first version of the Back to Office App is now ready! Three weeks from an idea to a functional app. Built in Power Apps, tight integration with Microsoft Teams and available free of charge for any Office 365 customer (no additional licenses required).

As economies and businesses reopen, organizations need a way to gradually open their office facilities for their workers while keeping everyone safe. Facilities teams are working to restructure building layouts, and seating arrangements to maintain social distancing norms and control building occupancy thresholds. They need a way to manage, track and report employee onsite presence.

Annotation 2020-06-22 154521Annotation 2020-06-22 154354Annotation 2020-06-22 154606Annotation 2020-06-22 154849

Solution Overview

  • Suite of three Apps – Building Access user app for employees to request access, Building Admin companion app to manage building availability, occupancy thresholds & eligibility criteria and Building Security app to verify onsite access and check in users.
  • Released as production ready ‘open source’ App template on GitHub that can be configured and adapted by organizations based on their business needs. https://github.com/microsoft/powerapps-tools/tree/master/Apps/BuildingAccess
  • Built using Power Apps, Power Automate, SharePoint and Power BI with deep integration with Teams for collaboration.
  • Included Power BI Dashboard provides executives and facility managers insights need to manage facility readiness with current and projected occupancy rates.
  • Leverages seeded Power Platform licenses in Office 365 for the three Power Apps.
  • Available in 44 different languages from day 1.

Personas

Four different personas/profiles interact in a collaborative process to ensure safe return to office.

Executives & Facilities Managers

Employee (Requestor)

Manager (Approver)

Security Team

  • Define availability and occupancy threshold for each building.
  • Define key eligibility criteria (health related questions) for onsite access
  • Define criteria for auto approval vs manager approval
  • Ensure only approved workers are allowed onsite
  • Track workers onsite at any location worldwide and projected turnouts
  • Publish important instructions for onsite access
  • Leverage insight for Planning
  • Request onsite building access for one or more days (in daily blocks)
  • Check on submitted requests and track approvals and rejection.
  • Withdraw requests as plans change
  • Ability to check-in and check-out
  • Pull up the approval QR Code for security check in (for restricted entry)
  • Check on latest company news
  • Approve onsite access for direct reports once the auto approval thresholds are met
  • Ability to bulk approve/reject requests
  • Track team members that will be onsite at an office location
  • Confirm worker is approved for entry prior to allowing access to premises
  • Check in workers by scanning a QR code or by pulling up information using key employee data
  • Provide emergency approvals for onsite access

The package is now available on GitHub. Talk to your Customer Success Manager, engage our partner ecosystem, install the tool, customize if required. You’re free to use it to support a safe return to Office.

Reach out if you have any questions or need help to understand the tool, requirements, etc.

Cristiano.

Disclaimer – The information contained in this blog post doesn’t represent the official Microsoft guidance or best practices. It is just the view of the author on current alternatives, implementations and workarounds for common issues and/or business needs. Please refer to official Microsoft documentation and evaluate carefully any steps, code or procedures documented herein. The author doesn’t offer any warranty. Use this information at your own risk.