PowerApps Data Types
- Sean Foote
- Oct 12, 2019
- 3 min read
Updated: Jan 10, 2024
As a part of things I wish someone explained to me when I started building PowerApps, here's some thoughts on the basic building blocks of data in PowerApps.
This is geared toward anyone who has ever gotten a "invalid data type" error or "invalid argument type" error and can't understand what the heck PowerApps is trying to tell them.
If you're looking for the technical reference from Microsoft, please go here. Personally, I spent a lot of time combing through these articles on Microsoft's site. Generally I felt like I was reading a dictionary full of words that I had to look up or didn't seem to apply to what I was trying to do, so it was confusing. Therefore, I decided to write this to help explain what to do for the layperson instead of just telling you to read the owner's manual.
Data Types - Overview
I'm going to walk you through these in detail, but before we get there, I need to explain some jargon about all of them together. I'm going to use Excel terms where I can because I came to PowerApps from an Excel background, and I'm guessing you probably have at least some familiarity with Excel.


Besides a strange color scheme, what do we have here:
Table
In PowerApps, a table is akin to a spreadsheet in Excel. It comprises columns and rows, often representing data connected from sources like SharePoint or SQL. Even single-field data with multiple rows is considered a table in PowerApps.
Record
A record is a single row of a table. This would be a single entry of data from a response form or other input method.
Value
Values in PowerApps are the data points housed in a table. They come in various types, such as Text, Number, Boolean, Date, and Time, representing the intersection of a column and a row in a table.
Practical Application
Now let's put together a few of these ideas together in a practical example.
If you wanted to find a single value inside of a table, you would need some dot notation. Here I've hard coded in the same sample data that I was showing in Excel (remember the one with the questionable color scheme?)

Normally this would be the name of your data table from SharePoint, SQL, Excel in OneDrive, or wherever else you're pulling in your data from. I would highly recommend you only hardcode values like this in some strange situations I won't detail here. I opted to do it here to show that it's a possibility and it was easy. Please note that DataTable1 says "There are no fields in this data table." From the diagram above, we know that a field is a column. Not only does that mean that we have a valid table, but we know we just need to tell it which columns we'd like to see!

Then we just click the check marks next to the different fields (columns) we want to show in this data table.

Note that PowerApps has determined the data type for what is displayed in each field. If you're having trouble getting data to display, this is a good trick for having PowerApps tell you what kind of data it thinks is in each field.
Now we're going to use some dot notation to get information from a table. A DataTable has a way of selecting a row and is readable by other controls.
DataTable1.Selected

Here I'm trying to show a record inside of a label. Labels cannot display records. Therefore there's an error and it declares that it expected a text value. Note the helpful pop-up message that appears when you hover on the word with the red squiggle underline AND the helpful information that DataTable1.Selected is a Data Type: Record just below the formula.
We have a few options now, the simplest is just to add a period and tell it which field we want displayed in the label

To reiterate, we had a table (DataTable1) then selected a single row (.Selected) and a particular value (.Score)
Conclusion
Understanding PowerApps data types is fundamental to building efficient and error-free applications. While it might seem daunting initially, mastering these basics will open up a world of possibilities in app development. For further exploration, Microsoft's documentation provides an in-depth technical reference.
Remember, the key to mastering PowerApps data types lies in practice and continual learning. Happy app building!
コメント