Disable/Enable Text Label Based On Specific Data On Canvas App

Disable/Enable Text Label Based On Specific Data Canvas App:

Based on default/certain data – we need to convert it into meaningful/blank value.

High level resolution steps

  • Here I’m taking example of Birthday and Anniversary where Birthday dates and Anniversary are blank and in that case default date is showing. But I want to show blank label.

Detailed resolution steps

Step 1: In starting I’m getting the default value in Birthday and Anniversary labels because value is not present and data is coming dataverse.

Step 2: Now, for removing the default value I need to code in “Birthday” and “Anniversary” label.
Add this below formula in “text” property


    If(
DateValue(ThisItem.BirthDate) = Date(1900, 1, 1),
"",
Text(DateValue(ThisItem.BirthDate), "yyyy-mm-dd")
)

    

Output

Above code states that when we received default “Birthday” as “1900-01-01” then birthday label
should show as blank as shown in below picture:

when you have some “Birthday” value in label that value will be shown in that label.