Conditionally format control text with formulas using the IF function. Learn about specifying colors by name or by RGB values.
- [Instructor] Here's the last spiffy little thing we're going to do to this power app, and that's to apply some conditional formatting to a control. This is the type of thing that makes an app much easier for our users. I'm going to select in the gallery, the very first item, and choose the availability, because what I'd like to do is flag if these items have been back-ordered. Now, generally, the color that we have applied here to this text is orange, and I'm going to switch it back to something a little bit duller, like a dark brown, and now they are all dark brown.
Now, it's hard to make red stand out from orange. What I'm going to do is choose a color, and say if, this is going to seem really familiar, almost like Excel. If availability equals back-ordered, make sense? Comma, and they're telling about the color here.
So, if the availability is equal to back-ordered, then let's simply choose some color in the red family. We have red, dark red, Indian red. Choose dark red. And if it's not that color, I wonder what we'd call this other color that we have here. Maybe it's brown, rosy brown, saddle brown. Let's try saddle brown.
Now, there's not a big distinction here between the saddle brown and the rosy brown, so let's choose a different color. A darker color, perhaps. Or perhaps even a simple black rather than red. Back we go again. Rather than saddle brown, let's choose black. Lotto black. Just black.
Now, if we wished, we don't have to satisfy ourselves with just two colors here. We could say if availability equals back-ordered, dark red, comma, if availability equals in stock, brown, comma, and then our else. Ultimately, our very last if is an else, just as it is in Excel, and therefore, if it's not back-ordered, and it's not in stock, perhaps it's unavailable, and that might be red. But this looks good, and notice that as I change these, the app itself is being updated.
So, in this case, if availability is equal to back-ordered, paint it dark red. Otherwise, it's in stock, and in that case, simply make it white. So, we only see that something is back-ordered if it's not in stock. Pretty slick. I'm going to save my app again, now that I've applied this conditional formatting, and return.
- Signing up for PowerApps and Microsoft Flow
- Importing a custom list from Excel
- Creating and managing a PowerApp from SharePoint
- Formatting text, modifying settings, and branding your app
- Updating app forms and the data source for an app
- Applying conditional formatting to a control
- Creating a flow for a SharePoint list
- Adding data using a mobile app
- Viewing results in Flow