![Power-BI-Content-Article.png](https://quantinsightsnetwork.com/wp-content/uploads/2024/04/Power-BI-Content-Article-678x381.png)
In this tutorial, we’ll be learning about PowerApps functions and formulas. This gives us a good foundation in creating the rest of our Power App by ourselves.
We can use PowerApps functions and formulas to improve the functionality and change the behavior in our Power Apps canvas app.
PowerApps Functions And Formula Reference
Microsoft has an amazing resource in the documentation called Formula reference for Power apps.
![1-6 | Master Data Skills + AI PowerApps functions](https://blog.enterprisedna.co/wp-content/uploads/2021/11/1-6-1024x576.jpg)
![1-6 | Master Data Skills + AI PowerApps functions](https://blog.enterprisedna.co/wp-content/uploads/2021/11/1-6-1024x576.jpg)
This contains all the different formulas and functions that Power Apps has for us to do everything we needed to do. Those are all the things that we would put in this formula bar. For example, in this record, I concatenated the first name and last name together.
![2-5 | Master Data Skills + AI PowerApps functions](https://blog.enterprisedna.co/wp-content/uploads/2021/11/2-5-edited.jpg)
![2-5 | Master Data Skills + AI PowerApps functions](https://blog.enterprisedna.co/wp-content/uploads/2021/11/2-5-edited.jpg)
I used the Concatenate function for that.
![3-5 | Master Data Skills + AI PowerApps functions](https://blog.enterprisedna.co/wp-content/uploads/2021/11/3-5-1024x576.jpg)
![3-5 | Master Data Skills + AI PowerApps functions](https://blog.enterprisedna.co/wp-content/uploads/2021/11/3-5-1024x576.jpg)
We can also click it on the reference page to see exactly how it works. We’ll see what Concatenate does, the difference between Concatenate and the Concat function, and their corresponding syntax.
![4-5 | Master Data Skills + AI PowerApps functions](https://blog.enterprisedna.co/wp-content/uploads/2021/11/4-5-1024x576.jpg)
![4-5 | Master Data Skills + AI PowerApps functions](https://blog.enterprisedna.co/wp-content/uploads/2021/11/4-5-1024x576.jpg)
We’ll also see some examples which allow us to better understand how it works.
![5-5 | Master Data Skills + AI PowerApps functions](https://blog.enterprisedna.co/wp-content/uploads/2021/11/5-5-1024x576.jpg)
![5-5 | Master Data Skills + AI PowerApps functions](https://blog.enterprisedna.co/wp-content/uploads/2021/11/5-5-1024x576.jpg)
This reference is really useful especially if we want to try to do something we don’t know how to do. Let’s now go through an example.
Utilizing The Concatenate Function In PowerApps
In this example, let’s try to concatenate the DateJoined data to the Location data in this element.
![6-5 | Master Data Skills + AI PowerApps functions](https://blog.enterprisedna.co/wp-content/uploads/2021/11/6-5-1024x576.jpg)
![6-5 | Master Data Skills + AI PowerApps functions](https://blog.enterprisedna.co/wp-content/uploads/2021/11/6-5-1024x576.jpg)
To do that, we need to use this formula.
![7-5 | Master Data Skills + AI PowerApps functions](https://blog.enterprisedna.co/wp-content/uploads/2021/11/7-5-1024x576.jpg)
![7-5 | Master Data Skills + AI PowerApps functions](https://blog.enterprisedna.co/wp-content/uploads/2021/11/7-5-1024x576.jpg)
However, this formula won’t work and will produce an error.
![8-4 | Master Data Skills + AI PowerApps functions](https://blog.enterprisedna.co/wp-content/uploads/2021/11/8-4-1024x576.jpg)
![8-4 | Master Data Skills + AI PowerApps functions](https://blog.enterprisedna.co/wp-content/uploads/2021/11/8-4-1024x576.jpg)
That’s because the Concatenate function only accepts either a Text or a table column of Text type. In our formula, we referenced the Location record which is a text/string. But we also referenced the DateJoined record which is a date and not a text/string type.
![9-5 | Master Data Skills + AI PowerApps functions](https://blog.enterprisedna.co/wp-content/uploads/2021/11/9-5-1024x576.jpg)
![9-5 | Master Data Skills + AI PowerApps functions](https://blog.enterprisedna.co/wp-content/uploads/2021/11/9-5-1024x576.jpg)
So how do we turn a date into a text/string type?
Formatting Data Type Using The Text Function In PowerApps
Well, we need to use the Text function which converts any value and formats a number or date/time value to a string of text.
![10-4 | Master Data Skills + AI PowerApps functions](https://blog.enterprisedna.co/wp-content/uploads/2021/11/10-4-1024x576.jpg)
![10-4 | Master Data Skills + AI PowerApps functions](https://blog.enterprisedna.co/wp-content/uploads/2021/11/10-4-1024x576.jpg)
Let’s now add it to our formula. It doesn’t require an argument, but it still allows us to specify the format that we’d like the converted value to produce. For this example, let’s just use the ShortDate format. Moreover, let’s add a space to separate the location and the date.
![11-5 | Master Data Skills + AI PowerApps functions](https://blog.enterprisedna.co/wp-content/uploads/2021/11/11-5-1024x576.jpg)
![11-5 | Master Data Skills + AI PowerApps functions](https://blog.enterprisedna.co/wp-content/uploads/2021/11/11-5-1024x576.jpg)
As a result, we have the customer’s name, their location, and the date when they joined.
![12-5 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/11/12-5-942x1024.jpg)
![12-5 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/11/12-5-942x1024.jpg)
Configuring Dates Using The Month And Year PowerApps Functions
However, the date format is obviously too detailed. We probably only need the year and month. To display only the year and month, we need to use the Month and the Year functions separately.
![13-5 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/11/13-5-1024x576.jpg)
![13-5 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/11/13-5-1024x576.jpg)
Let’s now change our formula and use the Month and Year functions. Don’t forget to use the Text function again to convert the dates into strings.
![14-5 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/11/14-5-1024x576.jpg)
![14-5 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/11/14-5-1024x576.jpg)
Once we’re done with that, we’ll now see that the date only displays the month and year they joined.
![15-4 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/11/15-4-942x1024.jpg)
![15-4 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/11/15-4-942x1024.jpg)
Exploring Other PowerApps Functions In The Reference Material
Let’s try to check out other available functions in the Microsoft reference documentation.
1. The Refresh Function
First, let’s check out the refresh function that was used in this element.
![16-6 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/11/16-6-1024x576.jpg)
![16-6 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/11/16-6-1024x576.jpg)
Then, let’s see what refresh does.
![17-5 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/11/17-5-1024x576.jpg)
![17-5 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/11/17-5-1024x576.jpg)
As expected, this function retrieves a fresh copy of a data source. It needs a data source as an argument.
![18-5 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/11/18-5-1024x576.jpg)
![18-5 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/11/18-5-1024x576.jpg)
In this example, the data source is Table1.
![19-4 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/11/19-4-1024x576.jpg)
![19-4 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/11/19-4-1024x576.jpg)
2. The Today Function
Another thing that’s also really cool is the Today function. Instead of using the table name as the title, we can change it to the date today.
![20-4 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/11/20-4-1024x576.jpg)
![20-4 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/11/20-4-1024x576.jpg)
To do that, we’ll use the Today function in our formula.
![21-5 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/11/21-5-1024x576.jpg)
![21-5 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/11/21-5-1024x576.jpg)
Now it displays the date of recurrence today. If we’ll check out this app tomorrow, it’ll return the date for tomorrow and so on and so forth.
![22-4 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/11/22-4-1024x576.jpg)
![22-4 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/11/22-4-1024x576.jpg)
We can see a detailed explanation of this function in the reference material as well.
![23-4 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/11/23-4-1024x576.jpg)
![23-4 | Master Data Skills + AI](https://blog.enterprisedna.co/wp-content/uploads/2021/11/23-4-1024x576.jpg)
***** Related Links *****
Power Apps Fundamentals: Basic Functionality And Customization
Power Apps Environments: Setting Up The App Elements Properly
PowerApps Integration In Microsoft Power Automate
Conclusion
In a nutshell, it’s a good way to learn about these things when working with Power Apps. As I’ve mentioned, there’s a lot of different functions that we can use.
We can always check the reference material from Microsoft whenever we want to explore the functions and formulas. And I highly recommend that you go through all those functions because it makes knowing what to do and debugging easier.
All the best,
Henry
Be the first to comment