Forum Discussion
Acorn999
Jul 13, 2023Brass Contributor
If(Not(IsBlank([DataCardValue]) is always returning true in cases where it should not
I have a Power Apps Canvas app with a tab-like experience developed. The tabs are created from a gallery of buttons. There are fields on each tab. If a tab is selected, the tab fill should be bl...
- Jul 14, 2023I started a new issue titled: Incompatible types for comparison. These types can't be compared: Table, Number. Setting this update as the best response on this issue so the issue won't have duplicate tickets.
TejpalBisht
Sep 03, 2024Copper Contributor
Try this
If(DataCardValue1.Selected.Value=Blank(),1,2)
- DataCardValue1.Selected.Value: This refers to the value selected in a data card control named "DataCardValue1". Data cards are used to display and edit data in a form.
- Blank(): This is a function that checks if a value is empty or null.
- If(condition, value_if_true, value_if_false): This is the If function in Power Apps. It evaluates the condition and returns the value_if_true if the condition is true, and the value_if_false if the condition is false.
So, in this case, the If statement is checking if the selected value in DataCardValue1 is empty. If it is empty, the function will return 1. Otherwise, if the selected value is not empty, it will return 2.
This function can be used to perform different actions or calculations based on whether a specific data card value is empty or not.