Fix Incompatible Types Error in Power Apps IF Formula for Data Cards
Question details
The user needs to conditionally show or hide data cards in a Canvas Power App using an IF formula based on a drop-down selection.
- Product
- Power Apps
- Device & OS
- not provided
- Scenario
- Setting the Visible property of a data card based on a Dataverse Choice field selection in a drop-down menu.
- Observed behavior
- The Visible formula triggers an 'incompatible types of comparison' error when trying to compare a data card value with plain text or a Dataverse Choice value.
Verify the exact schema name of your Dataverse Choice column and confirm whether the drop-down control is returning a record, a text value, or a specific choice property.
Resolve Data Type Mismatches in Dataverse Choice Comparisons
Fix the formula by explicitly referencing the choice record's underlying value or label to ensure both sides of the comparison share the exact same data type.
Dataverse Choice fields return complex choice records rather than simple plain text strings. When you attempt to compare a choice record directly to a text string in your Visible formula, Power Apps flags an incompatible types error.
Open your Canvas App in edit mode and click on the specific data card you want to conditionally show or hide from the Tree View.
Navigate to the Properties pane on the right side of the screen, or use the top formula dropdown menu to select the 'Visible' property.
Update your IF statement to extract the text value from the choice. Instead of comparing the choice directly, use a formula similar to: If(DataCardValue.Selected.Value = "Your Expected Text", true, false).
Check the formula bar for any remaining red underline errors. Hover over the variables to ensure both sides of the equals sign are recognized as 'Text' or 'Choice'.
Need a simpler way to manage conditional data?
While Microsoft Power Apps is designed for robust custom application development, many everyday conditional data tracking and formatting tasks can be easily managed using WPS Spreadsheet. WPS Office provides a free, highly compatible alternative to Microsoft Office that is perfect for straightforward data management.
- 1. Open WPS Spreadsheet: Launch WPS Office and open a new or existing spreadsheet to manage your data.
- 2. Apply conditional formulas: Select a target cell, type '=IF(', and define your logical conditions to automatically display specific outcomes.
- 3. Use conditional formatting: Navigate to the Home tab and click 'Conditional Formatting' to visually highlight or hide data based on cell values.

Frequently Asked Questions
Why does Dataverse Choice return an incompatible type error in Power Apps?
Dataverse Choice fields return complex record objects instead of simple text strings. Comparing this complex object directly to a text string causes a data type mismatch error in the formula bar.
How do I conditionally hide a button or card in Power Apps?
Select the element you want to control, go to its 'Visible' property in the formula bar, and enter a boolean formula (such as an IF statement or a direct logical check) that evaluates to true or false.
Can I evaluate multiple conditions for the Visible property?
Yes. You can combine multiple logical checks using operators like '&&' (AND) or '||' (OR) within your IF function, ensuring each condition correctly matches the expected data types.




