0% found this document useful (0 votes)
3 views

Data types

The article details the various data types supported by Power Fx, including Boolean, Choice, Color, Currency, Date, DateTime, Decimal, Float, GUID, Hyperlink, Image, Media, Number, Record, Table, Text, Time, Untyped, Void, and Yes/No. Each data type is described with examples and its application in handling data values, particularly when connected to external data sources. Additionally, it discusses the concept of blank values and how to manage them using specific functions.

Uploaded by

rafael.silva1909
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Data types

The article details the various data types supported by Power Fx, including Boolean, Choice, Color, Currency, Date, DateTime, Decimal, Float, GUID, Hyperlink, Image, Media, Number, Record, Table, Text, Time, Untyped, Void, and Yes/No. Each data type is described with examples and its application in handling data values, particularly when connected to external data sources. Additionally, it discusses the concept of blank values and how to manage them using specific functions.

Uploaded by

rafael.silva1909
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

Data types

Article
01/16/2025
9 contributors
In this article
Blank
Text, Hyperlink, Image, and Media
Numbers
Date, Time, and DateTime
Choices and Yes/No
Information flows through Power Fx in small, discrete values, very much like the
cells of a spreadsheet. For example, data in a Birthday field and an Anniversary
field would both flow through as a Date value that includes the year, the month,
and the day. Power Fx knows how to format these values, constrain input to what is
appropriate for each, and share the values with a database. Birthdays differ from
anniversaries to people, but the system handles them in exactly the same manner. In
this case, Date is an example of a data type.

This article provides details for the data types that Power Fx supports. When Power
Fx connects to an external data source, each data type in that source is mapped to
a data type in Power Fx.

Data type Description Examples


Boolean A true or false value. Can be used directly in If, Filter and other
functions without a comparison. true
Choice A choice from a set of options, backed by a number. This data type
combines a localizable text label with a numeric value. The label appears in the
app, and the numeric value is stored and used for comparisons. This data type is
supported by the Type function if an instance of a Choice field is used by name.
ThisItem.OrderStatus
Color A color specification, including an alpha channel. Color.Red
ColorValue( "#102030" )
RGBA( 255, 128, 0, 0.5 )
Currency A currency value that's stored in a floating-point number. Currency
values are the same as number values with currency-formatting options. The Currency
data type is not supported by the Type function. 123
4.56
Date A date without a time, in the time zone of the app's user. Date( 2019, 5,
16 )
DateTime A date with a time, in the time zone of the app's user.
DateTimeValue( "May 16, 2019 1:23:09 PM" )
Decimal A number with high precision, base 10 operations, and limited range.
123
Decimal( "1.2345" )
Float A number with standard precision, base 2 operations, and a wide range. 123
8.903e121
1.234e-200
GUID A Globally Unique Identifier. GUID()
GUID( "123e4567-e89b-12d3-a456-426655440000" )
Hyperlink A text string that holds a hyperlink.
"https://powerapps.microsoft.com"
Image A Universal Resource Identifier (URI) text string to an image in .jpeg, .png,
.svg, .gif, or other common web-image format. The Image data type is not supported
by the Type function. MyImage added as an app resource
"https://northwindtraders.com/logo.jpg"
"appres://blobmanager/7b12ffa2..."
Media A URI text string to a video or audio recording. The Media data type is not
supported by the Type function. MyVideo added as an app resource
"https://northwindtraders.com/intro.mp4"
"appres://blobmanager/3ba411c..."
Number An alias for Decimal (most Power Fx hosts) or Float (Canvas apps). If
either variety of number could be used for a given situation, use Number for
maximum compatibility. 123
0.0123
1e4
Record A record of data values. This compound data type contains instances of
other data types that are listed in this topic. More information: Working with
tables. This data type is supported by the Type function if an instance of a Record
is used. { Company: "Northwind Traders",
Staff: 35,
NonProfit: false }
Record reference A reference to a record in a table. Such references are often
used with polymorphic lookups. More information: Working with references. This data
type is not supported by the Type function. First(Accounts).Owner
Table A table of records. All of the records must have the same names for their
fields with the same data types, and omitted fields are treated as blank. This
compound data type contains instances of other data types that are listed in this
topic. More information: Working with tables. This data type is supported by the
Type function if an instance of a Table is used. Table( { FirstName: "Sidney",
LastName: "Higa" },
{ FirstName: "Nancy",
LastName: "Anderson" } )
Text A Unicode text string. "Hello, World"
Time A time without a date, in the time zone of the app's user. Time( 11, 23, 45 )
Untyped An object of an undeclared type. The underlying object could be any
existing type, and can be converted into compatible types using functions such as
Boolean(), Value(), Table(), etc. For more information, see Untyped object and
Working with JSON. ParseJSON("{ ""Field"" : 1234 }").Field
Void Used only by behavior user defined functions, it indicates that a function
does not have a return type. This data type is not supported by the Type function.
Even though a function does not have a return type or value, it can always return
an error. Hi(): Void = { Notify( "Hello!" ) }
Yes/No A choice from a set of two options, backed by a boolean value. This
data type combines a localizable text label with a boolean value. The label appears
in the app, and the boolean value is stored and used for comparisons. This data
type is supported by the Type function if an instance of a Yes/No field is used by
name. ThisItem.Taxable
Many of these data types are similar and have the same underlying representation,
such as a Hyperlink field being treated as Text. The extra data types provide
better default experiences in forms and other controls.

Blank
All data types can have a value of blank (in other words, no value). The term
"null" is often used in databases for this concept.

Use the Blank function with the Set or Patch function to set a variable or field to
blank. For example, Set( x, Blank() ) removes any value in the global variable x.

Test for a blank value by using the IsBlank function. Replace possible blank values
with non-blank values by using the Coalesce function.

Because all data types support blank, the Boolean and Two option data types
effectively have three possible values.

Text, Hyperlink, Image, and Media


All four of these data types are based on a Unicode text string.

Embedded text
Embedded text strings in a formula are enclosed in double quotation marks. Use two
double quotes together to represent a single double quote in the text string. For
example, using the following formula in the OnSelect property of a Button control:

Power Fx

Copy
Notify( "Jane said ""Hello, World!""" )
results in a banner when the button is pressed, where the first and last double
quotes are omitted (as they delimit the text string) and the repeated double quotes
around Hello, World! are replaced with a single double quote:

pop up notification with the message Jane said "Hello, World."

Single quotation marks are used for identifier names that contain special
characters and have no special significance within a text string.

You might also like