All posts in PowerApps

Building a Modern SharePoint Solution: Part 3 – Customizations All List Form PowerApps Should Have

In this third post in my series on modern SharePoint solutions, I will cover customizing PowerApp forms to meet the requirements of the business.  We’ll first start off with some basic customizations that need to be done for most form integrations.  When I started to write this post I initially had planned to discuss the modifications you should make for all and then move on to the custom modifications for the solution requirements.  The “default mods” quickly filled up this post, so I have moved the custom mods to the next one.

Posts in this series:

Read more

Building a Modern SharePoint Solution: Part 5 – Cascading Drop-down Lists and People Picker in PowerApps

This is going to be the last PowerApp based post in this series.  After this, I will be moving on to completing the solution with Microsoft Flow.  In this post, I will show you how to create cascading drop-down lists in PowerApps.  This corresponds to the requirement in my first post: “Ability to select from a list of approvers based on the project or event.”  This was something that could be done in InfoPath, but it was a LOT of steps.  In PowerApps, cascading drop-downs are actually pretty straightforward once you get the hang of it.  I, however, decided to do the hardest type of cascading drop-down there is with regards to SharePoint. Building a drop-down around a regular field is nice and easy; cascading drop-downs to select a person\group value is much more difficult.

Posts in this series:


Read more

Microsoft PowerApps – Updating a Data Card from a Button

So the other day I was playing around with some field manipulation in PowerApps and thought about a use case I saw often with respect to updating fields when code from a button or some other action occurs.  Say for instance you wanted to update a hidden field with some information when a user clicked a button or completed some task on the form.  Maybe it isn’t a hidden field, but whatever the case may be, you need to be able to update that field.  I was surprised to note that it isn’t very intuitive in PowerApps, nor could I find much out there in the forums.  I did find some information around doing it with a Text Input field, but nothing specific to a data card.

Read more

Microsoft PowerApps – Configure Your Data Cards to Look Like Data Cards

When building your data views in PowerApps, the items can look a bit blended together.  You can add separators, but things may still not look quite as nice.  For example, a simple view of the data (in this case the contents of a list) may look like this:

Configure Your Data Cards to Look Like Data Cards - No Formatting

This looks ok, but I would prefer to have each item be a bit more distinct.

Read more

Modifying the PowerApps Display Styles Based on Field Values

By default, browsing items in a list with a PowerApp the items all look the same.  This is fine in most cases, but I want to ensure the managers viewing the items can see items that are older first.  I could do this by modifying the search parameters for the browse screen to put the oldest at the top, but I want the older ones to jump out a bit.  So right now logging in, a user is going to see this:

Modifying the PowerApps Display Styles Based on Field Values - Default View

I want to modify the view so that the text of each is a different color depending on the age of the request and also how close the request start date is from the current date.  So initially I want the colors set based on the following criteria:

  • If less than 7 days old: Green
  • If more than 7, but but less than 14: Yellow (<– Yellow on white background is hard to see)
  • If more than 14 days: Orange
  • If the current day is less than 21 days from the start date: Red

This is where conditionals come into play.  Like all programming languages, PowerApps allows you to use conditional statements to control objects.  If…then…else, switch statements, etc are all available to allow you to conditionally manipulate your environment.  In this case I want to use conditionals to control how the text will appear.

The format of an IF conditional is If(<Condition>,<then>,<else>) or If(<Condition>,<then>,<elseif condition>,<then>,….)

For example: if I wanted to use an if statement for the text color of the user’s name I would put the following formula on the color attribute:

Today() is a function similar in function to Date.Now().  So what the statement above states is if the item created date is within the last 7 days, change the color to green.  Applying the function to the above list items will give us the second item as green for the Name field:

Modifying the PowerApps Display Styles Based on Field Values - Formatting The Name

If I wanted to do show a couple of my options above I would need to use an if\elseif conditional.  So for the Green and Yellow conditional I want:

Modifying the PowerApps Display Styles Based on Field Values -  Multiple Conditionals

So that’s just two conditionals.  As you can see it could get pretty long.  I would love to say that we could move to a switch statement using something like this:

However, currently only comparisons to constants will work. For instance if you did a math calculation of “NumDaysDif = Today() – ThisItem.Created” and had a result of 5 you could then do this in your switch statement and get the result you want:

Unfortunately this is not an option currently.  So to accomplish what I want to do I need to write a long if statement.  The final statement will look something like this:

And when added to all of the fields in the Browse Gallery your result should look something like this:

Modifying the PowerApps Display Styles Based on Field Values - All Fields Updated

Pretty straight forward once you get going.


Thanks for reading!