I want to share my experiences with PowerApps, Flow and SharePoint

For my last PowerApp project I wanted to create a setup where the styling is centrally managed for the PowerApp. I did not found a method yet online but this blog: Giving Consumers Color and Text Size Configuration Options from Audrie Gordon explained how to load the styling from a collection in the app. This is a great method. And I thought wat if I store my styling information in a SharePoint List and load that information in a collection at startup. I did some test and it works very well.

In this blog I will create a simple example how to setup the styling. The following components of a button/buttons will be styled: font, background color, border color, font size, font color and font weight.

In SharePoint created a custom list called “AppStyling”. Add an extra column “Single line of text” to the list called “Setting”.

I added my initial values in the list:

Next step is creating an app, adding a button on the start screen and connecting to the AppStyling list as a data source.

Load CollectionThen make sure the values from the styling list are loaded in a collection at startup.
Select the start screen, select the “on start” action and add the formula:ClearCollect(collStyling, AppStyling)

Now we have a collection with all the values available after startup. Now the properties are ready to be used for the styling in the app:

Set Border ColorTo set the border color, select the button and select the property “BorderColor”, add the formula: ColorValue(LookUp(collStyling, Title = “BorderColor”, Setting))

Set backgroundTo set the background color of the button, select the button and select the property “Fill”, then add the formula: ColorValue(LookUp(collStyling, Title = “BackgroundColor”, Setting))

Set FontTo set the font of the button, select the button and select the property “Font”, add the formula: LookUp(collStyling, Title = “Font”, Setting)

Set Font SizeTo set the font size, select the button and select the property “Size”, add the formula:LookUp(collStyling, Title = “ButtonFontSize”, Setting)

Set Font WeightTo set the font weight, select the button and select the property “FontWeight”, add the formula: LookUp(collStyling, Title = “FontWeight”, Setting)

Copy the button a couple of times.

Publish the app and load the app (in this case in the browser). Now all the styling defined in the AppStyling list is loaded in the app.

I recently started using the common data model in a PowerApps solution of mine. The Common Data Model is part of the Common Data Service and can be used to store information like in a Database. It is designed to act as a central location to store information and to be used by PowerApps, Power BI, Microsoft Flow and all kinds of services through connectors and gateways.

It contains predefined entities, the entities contain fields, all defined by Microsoft. The entities are from a general character so they are applicable for most companies.

In the following articles I describe some very nice functionalities that I used quite a lot during my developments.

For a PowerApps solution of mine I wanted to use the Common Data Model (CMD) as the storage location. During development I had to import information in my entities quite often. In this article I describe how to get an Excel template how to import the information with this template.

So, when you want to import existing content in a custom or default entity, you can easily import this from an Excel template.

Go to your Common Data Service environment. In my case it is in my PowerApps Environment.

Open and login in https://web.powerapps.com/Beneath the Common Data Service select Entities, find your entity and open it.
At the right top you see an action menu, select ‘Export template’

Select the fields you want to use for the import, you can be very specific in choosing your columns, select only the required fields or you can add all fields.

I choose the relevant fields only relevant for me, click ‘Export to Excel’, you can choose to export to Excel or Export as .csv. I choose Excel.

A template is generated, when finished you can download the template.

Save the file and open it with Excel in edit mode.
Now you can add your existing content in the file and save it, make sure that the information types match, otherwise the import will fail!

Now you are ready to import your data. Open your entity and select ‘Import data’ in the action menu.

Select your file, the columns in the excel file will be matched and mapped to the columns in the entity. (if you get an error try it again, I sometimes get an error, the second time the matching succeeds).

To check the mappings click ‘Show Mapping’, then you will see how the columns are mapped. If necessary you can update the mapping.

When ready click ‘Import’.

If the import succeeds your content is added, if the import fails you get an link to a report, in here you can analyze what causes the import failure, fix it and try again.

If the import is succeeded you see.

Now you are ready, when you go to your entity and select the data tab you will see your imported content.

For a PowerApps solution of mine I wanted to use the Common Data Model (CMD) as the storage location. During development I had to update some columns in my entity. Unfortunately you cannot change an existing column when it contains content, therefore you need to export the content to an Excel file, remove all the content, do your modifications/updates and import the data again. In this article I will describe the steps I take to Export the data to an Excel file and how to clear the content before updating your entity.

Go to the home screen of the entities, in the right side of the window select the dots. Select the “Clear all data” from the menu.

You will be asked to confirm you action, select Delete data.

When finished all data is removed from all entities.

Now you can update your entity, when ready, import the data as described here, select the exported xslx file as import source (depending on the updates you make on the entity you maybe should update the xslx file data to keep the same data types ).

Now you are ready, you’ve got all your content and your entity is updated.

For a PowerApps solution of mine I wanted to use the Common Data Model (CMD) as the storage location. During development I had to edit the content stored in a entity. I found out that the CDM has a great option to edit the content with Excel. This article describes what steps to take if you want to update content in you entity with Excel.

When you open an entity from the Common Data Model (CMD), you can select the data tab to see the content currently available in the entity. To work with the data in the entity Microsoft has created a great feature to directly edit/add/delete content in the entity. This can be done by the feature “Open in Excel”.

When you click this button the browser offers you a xslx file.
Click ‘Open’ to open the file in excel.

You probably will get a security pop-up, click ‘Allow’

Excel is opened in protected view, click ‘Enable Editing’

On the left site, the content is loaded and on the right side a Panel is shown, it is possible that you have to sign in, do this with your O365 credentials.

When you are logged in, you can easily create new content , edit or delete existing content.

When you want to apply the updates, press the Publish link at the right bottom. You will get a summary of changes, to apply them, select Yes.

You will get a successful message and the workbook will be updated.
Now the content in the entity is updated.

I recently started creating an app for a proof of concept. During development of the app I had to store some information like user Id, a true or false value. At first I added this information in text fields in hidden screens, this worked but did not really felt like the correct method. When variables became available storing information like this became much easier and using variables feels like the way to go.

I use the Set method to create a Global variable and directly add the required value, in this case a user Id.

This action is done add the On start of the app.

To create and set the variable at startup take the following steps:

Click the default screen

Select the On start button in the Ribbon (or in the drop-down next to the formula field)

Add the set variable formula like “Set(variableName, value)”

Now when the app is started the variable is initialized and filled your value, you can use the variable anywhere in you app.

To update the variable with another value, you can use the Set method again. This can be done on any action/trigger mostly the OnSelect action.

So the formula will be like “Set(variableName, NewValue)”

Hopefully this article helps someone setting up a PowerApp and using variables.