Tips for PowerApps-A drivers logbook

2017-01-04 | Toni Pohl

PowerApps are a great way to accomplish simple tasks by end users. A new PowerApp is usually done in minutes (if the underlying data source is existing and working). Nevertheless, it often takes much more time to polish the app and to find and modify details. So I decided to post from time to time some tips when stumbling upon any topics in PowerApps.

A driver’s log

I wanted to use a very simple custom SharePoint Online list to allow colleagues to log their travels with a company car. At every destination, the user shall simply protocol his location and the mileage, and optional some information about the customer or the appointment. Very little fields, just to keep it handy.

This was the goal – and the result: Three (four) screens.

The list shows all records of the current user, sorted by mileage descending, with driver, if the trip was private or for work, the date and the comment. The further screens show one record and allow to view, edit or create a new record.

image image

image image

Ok, I will play with the colors.. but I wanted to use the company colors. And I added an About page as well. Tip: Get nice icons at icons8.com.

Filtering the list

Anyway, here are the important parts. I wanted to accomplish the following appearance:

AFAIK, it’s still not possible, to use SharePoint views as data source (but it’s on the product team’s roadmap). My data source name is “Fahrtenbuch” (german for driver’s log), coming from a SharePoint list.

SNAGHTML5ad380c

Doing the filtering for the current user was the most important part. To make it quick: This came out to be the solution for that requirements:

Setting the collection Items property: Instead of (the generated filter)

SortByColumns(Search(Fahrtenbuch, TextSearchBox1.Text, "Driver","Location","Title"),
"Driver", If(SortDescending1, Descending, Ascending))

I used
SortByColumns(Filter( Fahrtenbuch, Lower(Office365Users.MyProfile().DisplayName) = Lower( Driver)
&& ( TextSearchBox1.Text in Location  || TextSearchBox1.Text in Title )),
"Milage", If(SortDescending1, Ascending,Descending))

Voila. The article Filter, Search, and LookUp functions in PowerApps helped!

Setting defaults

I added the data source for Office 365 users to get data about the current user. Setting the default for the current user is easy: Edit the properties of the data card in the edit form and set the Default value to Office365Users.MyProfile().DisplayName.

image

The same goes for the date. Here II used Today() as default value. Done.

So, when clicking the Plus icon in the list, the default values are set automatically, which saves time.

SNAGHTML5b1add5

Share it!

After checking that the app does what it should, share it. I decided that every user in my organization is able to use this wonderful app. This is done at the https://web.powerapps.com/environments website.

image

Enjoy your new PowerApp!

Categories: General, App, Azure, Cloud, Developer, English, Microsoft, Office365, SharePoint, PowerApps

Source: http://blog.atwork.at/post/2017/01/04/Tips-for-PowerApps-A-drivers-logbook