16 February 2017

PowerApp With Current User's Phone Messages

Microsoft PowerApps iconIf your organization uses a SharePoint list for phone messages, you can create a PowerApp from it and make a workflow hide all messages but the current user's. This way each user will see his/her own messages in the app. In two new articles in the Tips section, I describe how to achieve this.

Phone messages in the mobile
In some of my earlier tutorials I have described how to create and enhance a phone messages SharePoint list. Now there is one more: how to create a PowerApp that shows phone messages. Such messages are of course ideal to have in a mobile phone, and as PowerApps give a mobile friendly user interface, a phone messages PowerApp sounds like the perfect solution. It can be done, but you have to take some more steps after letting PowerApps auto-create an app from the SharePoint list.

Auto-creation from SharePoint
PowerApps has a button in the command bar of SharePoint lists with the new experience interface, so it is very easy to create a PowerApp from a list. But the result of the auto-creation is seldom optimal, and in the case of my simple phone messages app it is actually bad. The list only has four columns: Who called? (which is the re-named Title field), Telephone number (to call back), (the person who was) Called and a Yes/No column for Returned.

Microsoft PowerApps in SharePoint
No easy search for "my calls"
In SharePoint you can easily filter the list by Called, so that you can see only your own calls, but when you create a PowerApp all items will be included and there is no such filter option. There is a search, but it is only possible to search text fields.

I want the reception staff to be able to select the persons called among the SharePoint users, so 'Called' is a column of the type Person or Group and not a text column. This means that users cannot search for their own messages in the app.

Add the "Called" field
Even worse is that the "Called" field is not displayed in the Browse mode of the PowerApp, so users have to open each item to see who was called. Instead of Called, there is a rating field connected to the item ID, which is not very useful. In the demo below I show how to remove it and add the Called field instead.

Hide content
So, now the "Called" field is displayed in Browse mode, but if there are many messages in the list users will have to scroll a lot to find their messages, as all messages in the SharePoint list are displayed in the PowerApp.

To solve the problem and let each user see only his/her own messages, I suggest a SharePoint 2010 workflow, which can set permissions. Create an Impersonation Step that replaces all permissions with an edit permission for the person in the "Called" field. This way the items with "Lisa" in the "Called" field will be hidden for everyone but Lisa, and each user will see only his or her messages – in the SharePoint list as well as in the PowerApp. You have to be a site collection owner or admin to create such a workflow, and in the demo below I show how to create it.

With these two actions, you can create a much better PowerApp than the auto-created one. I have found that PowerApps quite often work like that. An experienced SharePoint admin can give users really efficient apps, but it might be difficult for other people to create something useful.

I must point out, though, that even with these modifications this PowerApp is far from perfect. For example it still shows all my phone messages, not only those I have to return. Further ideas would be to make the phone numbers clickable, so you can actually return your phone calls directly from the PowerApp and then mark the phone call as returned.

However, those modifications are for another demo. I hope you find this a useful example, even though the results need further improvement. If you want to try my suggestion, I recommend you to read the articles and not just watch the demos, as they give some extra information. And if you are new to PowerApps, study the introduction article and demo first.

Intro and Projects Power App
Phone Messages Power App
Hide Content

Peter Kalmström
CEO and Systems Designer Business Solutions

No comments:

Post a Comment