All posts in Office365

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!

 

Using SharePoint Lookup Type Fields in PowerApp Browse Screens

In my previous post I discussed how to create a new PowerApp directly from a SharePoint list.  I also indicated it had a few limitations that needed to be addressed.  One of these limitations was the default browse screen is not compatible with lookup type fields (People\Groups, Choice, Lookup, etc).  These field types are of course available in the details and edit screens, but not the browse screen.

Using SharePoint Lookup Type Fields in PowerApp Browse Screens - Bad User Experience

I can force the control to look at the field I want, but it doesn’t know how to convert the object into text.

Using SharePoint Lookup Type Fields in PowerApp Browse Screens - spUser Not Compatible

Being limited to just the text fields of the list or at least fields PowerApps knows how to treat as text (Date\Time fields) was creating a bad user experience in the forms I wanted to create. I had to come up with another way.  Using a calculated field in the SharePoint list won’t work because a calculated field can’t see those columns either.  It’s actually

Using SharePoint Lookup Type Fields in PowerApp Browse Screens

Because I want to be able to see these values on my browse screen they need to be converted to text.  The two fields I want on my browse screen that are not compatible with the view are:

  • Training Requested For – The name of the person taking the training (Person or Group field)
  • Training Requested – Title of the training course (Lookup Field)

Luckily there are formulas that can help us out here.  To display the name of the user PowerApps has the ability to call the DisplayName property of the field.

Using SharePoint Lookup Type Fields in PowerApp Browse Screens - Display Name of Person Field

To get the title of the training requested is just another property of the field.

Using SharePoint Lookup Type Fields in PowerApp Browse Screens - Displaying Lookup Field

I decided to get a bit fancier and add some text at the beginning of the value to add to the experience.  I wanted the field to read: Course Name: <“Name of the Course”>.  To do this, you simply combine two strings together (the can be variable based or static (what you typed)) inside a Concatenate function.

The final values I wanted on the form were the start date, End Date and total estimated cost.  Dates were straight forward as they are available from the drop down of the data properties.  The cost I had to get a bit fancy here too.  I wanted the cost to display as Total Estimated Cost: $XXXX.XX.  The problem now is that the Concatenate function requires strings and the TrainingCost field comes back as a numeric.  Enter in a another formula.  Text(<string>, formula) will convert a string to a formula.  The final formula looked like this:

When all was said and done I ended up with my form looking like this”

 

PowerApps is still pretty new, but there is a lot you can do with it.  I look forward to seeing where it will get to in the near future.

 

Thanks for Reading!

Creating a PowerApp from a SharePoint List

One of the recent innovations from Microsoft is the ability to integrate a PowerApp with a SharePoint list.  What this means is you no longer have to create the PowerApp separately from SharePoint and then create connections to the environment, but instead you can actually create the PowerApp from within the list itself.  What this doesn’t mean is that a PowerApp can replace the list forms for a SharePoint list.  However, in a recent post from the PowerApps team we will be getting this functionality very soon.

In this post, I am going to show you how to create a PowerApp from a custom list and show you around the PowerApp development tools a bit.  This post is actually the first in a series that I intend to use to show you the different things you can currently do with PowerApps.  I intend to integrate Microsoft Flow as well later as well.  Since this is the first post it makes sense to start with a brief explanation of the design and how to create the App.

Read more

PowerApps – Could not resolve jwt token. Could not resolve issuer token

Today I had decided to start a new blog series centred around Microsoft PowerApps.   I decided I wanted to build out a quick little training request app on a SharePoint list.  While starting out I ran into a bit of a snag while creating the first part of the PowerApp.  But I will summarise how things occurred.  I created the metadata I wanted to have in my list.  The list contained about 9 different fields including a User\Group field and a couple of look-ups.  When I attempted to create a Power App directly from the list I received the following error:

Invalid JWT token. Could not resolve issuer token.

Could not resolve jwt token. Could not resolve issuer token - Error Message

The full error was:

 

Going back to the list didn’t help any.  Even though I didn’t have a PowerApp created, the list thought it existed.

Could not resolve jwt token. Could not resolve issuer token - Remove View

Clicking “Remove this view” removes the PowerApp view from the list and doesn’t harm the metadata.

I thought at first I had a badly configured field, but nothing seemed out of place.  All of the fields were populating data as expected and the data saved successfully with the list forms.  Reviewing the error a bit closer it looked a lot like an access issue.  Problem is this is my tenant and currently I have only 3 accounts.  The one I was using was the global admin, so it shouldn’t have been that.

I then took a look at my PowerApps Admin console and noticed an exclamation point on the Connections menu.  Clicking on it, the newly created connection indicated the password needed to be updated.

PowerApps - Could not resolve jwt token. Could not resolve issuer token - Connection Error

Clicking on the “Update Password” option opens a dialog to the Microsoft portal.  I was then able to update my portal.  Next time I attempted to create my app it worked like a charm. I’ll talk about that next week. Hope this helps someone with a similar issue.

Thanks for reading!

Introducing Microsoft365

Remember last year Microsoft announced Secure Productive Enterprise?  Well, today at Microsoft Inspire (the rebranded Partner Conference) they rebranded it and I personally think it’s a great idea.  Welcome to Microsoft365.   In a nutshell, Microsoft365 is Office 365 and Windows 10 bundled together with Mobility for the Enterprise and all wrapped up in enterprise level security.  The following is my take on how the new product focus is going to help your business moving forward.

Microsoft365

Encouraging four main pillars the product is focused on, Satya Nadella made the announcement this morning (July 10, 2017).  Microsoft wants the tool to focus on Creativity, Teamwork, Simplicity, and Security.

Creativity

Creativity of course because with the product you will get all the tools you need to create great things.  You will get the same tools you have been using already like Word, Excel, PowerPoint, OneNote, etc).  With these, you can create everything you need in your day to day work.  From proposals to meeting notes to financial status with Microsoft365, you can create all this and so much more.

Teamwork

With Office365 you will be getting great tools to encourage and support teamwork.  SharePoint of course but now you can increase collaboration within your teams using other fantastic tools like Microsoft Groups, Microsoft Team, OneDrive for Business, Outlook and Exchange, Skype for Business, Yammer, and so much more.  Being able to accomplish tasks as a group has never been easier.

Simplicity

It’s all within one package for you.  No need to buy this tool for that job, or that tool for another job.  Everything you need is in Microsoft365.  And even if it isn’t (yet ;-D ) Microsoft has made connectors to many items for you to do just that.  Microsoft teams have connectors to social media like Twitter and Facebook.  Flow can also access these systems as well.  While it may seem less than simple and when first getting started it may very well be, but as you carve out your usage of Microsoft365 you will find having everything at your fingertips in one product couldn’t make it easier for you to get things done.

Security

With Microsoft365 you will be getting enterprise level security.  You will have Encryption, Data Loss Protection (DLP) and Information Rights Management all through Office365.  Thus fully securing your data from accidental loss, or being viewed by those who shouldn’t.  You will get great protection in your systems with Windows Information Protection, Credential Guard, App Locker and much more.  Remember that Office365 has released a fantastic security console that allows you to fully protect your environment even better than before.

What I think is fantastic is that you don’t have to purchase the items seperately.  As a business you now can group your most used individual products (Windows 10, business applications (Word, Excel, etc), collaboration tools like SharePoint, OneDrive, Skype, etc) and more all in one bundle.  It’s a great option for many businesses to use.  While not a huge new product for Microsoft, I think that the rebranding and launch of Microsoft365 is absolutely fantastic and looking forward to working with businesses to build out and support solutions utilizing this product.

 

Thanks for reading!!