When using True or False as criteria in a function they are considered to be Boolean values?

The OR function returns true if any of the provided arguments are logically true, and false if all of the provided arguments are logically false.

Sample Usage

OR(A2 = "foo", A3 = "bar")

OR(TRUE,FALSE,TRUE)

OR(A1:A10,B1:B10)

OR(0,1,2,3)

Syntax

OR(logical_expression1, [logical_expression2, ...])

  • logical_expression1 - An expression or reference to a cell containing an expression that represents some logical value, i.e. TRUE or FALSE, or an expression that can be coerced to a logical value.

  • logical_expression2, ... - [ OPTIONAL ] - Additional expressions or references to cells containing expressions representing some logical values, i.e. TRUE or FALSE, or expressions that can be coerced to logical values.

Notes

  • The number 0 is logically false; all other numbers (including negative numbers) are logically true.

See Also

NOT: Returns the opposite of a logical value - `NOT(TRUE)` returns `FALSE`; `NOT(FALSE)` returns `TRUE`.

AND: The AND function returns true if all of the provided arguments are logically true, and false if any of the provided arguments are logically false.

Examples

Returns TRUE if at least one argument is TRUE, accepts both logical_value and range parameter.

Was this helpful?

How can we improve it?

Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Blank, Coalesce, IsBlank, and IsEmpty functions in Power Apps

  • Article
  • 06/30/2022
  • 8 minutes to read

In this article

Tests whether a value is blank or a table contains no records, and provides a way to create blank values.

Overview

Blank is a placeholder for "no value" or "unknown value." For example, a Combo box control's Selected property is blank if the user hasn't made a selection. Many data sources can store and return NULL values, which are represented in Power Apps as blank.

Any property or calculated value in Power Apps can be blank. For example, a Boolean value normally has one of two values: true or false. But in addition to these two, it can also be blank indicating that the state is not known. This is similar to Microsoft Excel, where a worksheet cell starts out as blank with no contents but can hold the values TRUE or FALSE (among others). At any time, the contents of the cell can again be cleared, returning it to a blank state.

Empty string refers to a string that contains no characters. The Len function returns zero for such a string and it can be written in a formulas as two double quotes with nothing in between "". Some controls and data sources use an empty string to indicate a "no value" condition. To simplify app creation, the IsBlank and Coalesce functions test for both blank values or empty strings.

In the context of the IsEmpty function, empty is specific to tables that contain no records. The table structure may be intact, complete with column names, but no data is in the table. A table may start as empty, take on records and no longer be empty, and then have the records removed and again be empty.

Note

We are in a period of transition. Until now, blank has also been used to report errors, making it impossible to differentiate a valid "no value" from an error. For this reason, at this time, storing blank values is supported only for local collections. You can store blank values in other data sources if you turn on the Formula-level error management experimental feature under Settings > Upcoming features > Experimental. We are actively working to finish this feature and complete the proper separation of blank values from errors.

Blank

The Blank function returns a blank value. Use this to store a NULL value in a data source that supports these values, effectively removing any value from the field.

IsBlank

The IsBlank function tests for a blank value or an empty string. The test includes empty strings to ease app creation since some data sources and controls use an empty string when there is no value present. To test specifically for a blank value use if( Value = Blank(), ... instead of IsBlank.

When enabling error handling for existing apps, consider replacing IsBlank with IsBlankOrError to preserve existing app behavior. Prior to the addition of error handling, a blank value was used to represent both null values from databases and error values. Error handling separates these two interpretations of blank which could change the behavior of existing apps that continue to use IsBlank.

The return value for IsBlank is a boolean true or false.

Coalesce

The Coalesce function evaluates its arguments in order and returns the first value that isn't blank or an empty string. Use this function to replace a blank value or empty string with a different value but leave non-blank and non-empty string values unchanged. If all the arguments are blank or empty strings then the function returns blank, making Coalesce a good way to convert empty strings to blank values.

Coalesce( value1, value2 ) is the more concise equivalent of If( Not IsBlank( value1 ), value1, Not IsBlank( value2 ), value2 ) and doesn't require value1 and value2 to be evaluated twice. The If function returns blank if there is no "else" formula as is the case here.

All arguments to Coalesce must be of the same type; for example, you can't mix numbers with text strings. The return value from Coalesce is of this common type.

IsEmpty

The IsEmpty function tests whether a table contains any records. It's equivalent to using the CountRows function and checking for zero. You can check for data-source errors by combining IsEmpty with the Errors function.

The return value for IsEmpty is a Boolean true or false.

Syntax

Blank()

Coalesce( Value1 [, Value2, ... ] )

  • Value(s) – Required. Values to test. Each value is evaluated in order until a value that is not blank and not an empty string is found. Values after this point are not evaluated.

IsBlank( Value )

  • Value – Required. Value to test for a blank value or empty string.

IsEmpty( Table )

  • Table - Required. Table to test for records.

Examples

Blank

Note

At this time, the following example only works for local collections. You can store blank values in other data sources if you turn on the Formula-level error management experimental feature under Settings > Upcoming features > Experimental. We are actively working to finish this feature and complete the separation of blank values from errors.

  1. Create an app from scratch, and add a Button control.

  2. Set the button's OnSelect property to this formula:

    ClearCollect( Cities, { Name: "Seattle", Weather: "Rainy" } )
    
  3. Preview your app, click or tap the button that you added, and then close Preview.

  4. On the File menu, click or tap Collections.

    The Cities collection appears, showing one record with "Seattle" and "Rainy":

    When using True or False as criteria in a function they are considered to be Boolean values?

  5. Click or tap the back arrow to return to the default workspace.

  6. Add a Label control, and set its Text property to this formula:

    IsBlank( First( Cities ).Weather )
    

    The label shows false because the Weather field contains a value ("Rainy").

  7. Add a second button, and set its OnSelect property to this formula:

    Patch( Cities, First( Cities ), { Weather: Blank() } )
    
  8. Preview your app, click or tap the button that you added, and then close Preview.

    The Weather field of the first record in Cities is replaced with a blank, removing the "Rainy" that was there previously.

    When using True or False as criteria in a function they are considered to be Boolean values?

    The label shows true because the Weather field no longer contains a value.

Coalesce

FormulaDescriptionResult
Coalesce( Blank(), 1 ) Tests the return value from the Blank function, which always returns a blank value. Because the first argument is blank, evaluation continues with the next argument until a non-blank value and non-empty string is found. 1
Coalesce( "", "2" ) Tests the first argument which is an empty string. Because the first argument is an empty string, evaluation continues with the next argument until a non-blank value and non-empty string is found. 2
Coalesce( Blank(), "", Blank(), "", "3", "4" ) Coalesce starts at the beginning of the argument list and evaluates each argument in turn until a non-blank value and non-empty string is found. In this case, the first four arguments all return blank or an empty string, so evaluation continues to the fifth argument. The fifth argument is non-blank and non-empty string, so evaluation stops here. The value of the fifth argument is returned, and the sixth argument isn't evaluated. 3
Coalesce( "" ) Tests the first argument which is an empty string. Because the first argument is an empty string, and there are no more arguments, the function returns blank. blank

IsBlank

  1. Create an app from scratch, add a text-input control, and name it FirstName.

  2. Add a label, and set its Text property to this formula:

    If( IsBlank( FirstName.Text ), "First Name is a required field." )
    

    By default, the Text property of a text-input control is set to "Text input". Because the property contains a value, it isn't blank, and the label doesn't display any message.

  3. Remove all the characters from the text-input control, including any spaces.

    Because the Text property no longer contains any characters, it's an empty string, and IsBlank( FirstName.Text ) will be true. The required field message is displayed.

For information about how to perform validation by using other tools, see the Validate function and working with data sources.

Other examples:

FormulaDescriptionResult
IsBlank( Blank() ) Tests the return value from the Blank function, which always returns a blank value. true
IsBlank( "" ) A string that contains no characters. true
IsBlank( "Hello" ) A string that contains one or more characters. false
IsBlank( AnyCollection ) Because the collection exists, it isn't blank, even if it doesn't contain any records. To check for an empty collection, use IsEmpty instead. false
IsBlank( Mid( "Hello", 17, 2 ) ) The starting character for Mid is beyond the end of the string. The result is an empty string. true
IsBlank( If( false, false ) ) An If function with no ElseResult. Because the condition is always false, this If always returns blank. true

IsEmpty

  1. Create an app from scratch, and add a Button control.

  2. Set the button's OnSelect property to this formula:

    Collect( IceCream, { Flavor: "Strawberry", Quantity: 300 }, { Flavor: "Chocolate", Quantity: 100 } )

  3. Preview your app, click or tap the button that you added, and then close Preview.

    A collection named IceCream is created and contains this data:

    When using True or False as criteria in a function they are considered to be Boolean values?

    This collection has two records and isn't empty. IsEmpty( IceCream ) returns false, and CountRows( IceCream ) returns 2.

  4. Add a second button, and set its OnSelect property to this formula:

    Clear( IceCream )

  5. Preview your app, click or tap the second button, and then close Preview.

    The collection is now empty:

    When using True or False as criteria in a function they are considered to be Boolean values?

    The Clear function removes all the records from a collection, resulting in an empty collection. IsEmpty( IceCream ) returns true, and CountRows( IceCream ) returns 0.

You can also use IsEmpty to test whether a calculated table is empty, as these examples show:

FormulaDescriptionResult
IsEmpty( [ 1, 2, 3 ] ) The single-column table contains three records and, therefore, isn't empty. false
IsEmpty( [ ] ) The single-column table contains no records and is empty. true
IsEmpty( Filter( [ 1, 2, 3 ], Value > 5 ) ) The single-column table contains no values that are greater than 5. The result from the filter doesn't contain any records and is empty. true

Feedback

Submit and view feedback for

What types of questions do Boolean functions answer?

Functions like <, > and = all consume two Numbers as their Domain, and produce a special value called a Boolean as their Range. Booleans are answers to a yes-or-no question, and Boolean functions are used to perform tests.

Is the logical value TRUE treated the same as the text string true in Excel?

The logical value TRUE is treated the same as the text string "TRUE". In the order of operations for Excel (Order of Precedence), the relational operators (=, <>, <=, >=) are last.

What function should be used to count the number of items in a list that meet one and only one specific criterion?

The COUNTIF function uses the following arguments: Range (required argument) – This defines one or several cells that we wish to count. The range of cells are those cells that will be tested against the given criteria and counted if the criteria are satisfied. Criteria – This is a condition defined by us.

Why is it important to use cell references in functions or formulas in Excel quizlet?

Absolute cell references are important when referring to constant values in a spreadsheet. Using formulas in spreadsheets can allow you to quickly make calculations and get totals of multiple cells, rows, or columns in a spreadsheet.