web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Add text to label base...
Power Apps
Answered

Add text to label based on the value of booleon datacardvalue.

(0) ShareShare
ReportReport
Posted on by 22

Hello, I have seen other posts related to this, but the code I tried  from the does not work. I have large sharepoint list. One column is a choice: Do you need this app?. The value is a booleon on the edit page of the gallery.

I have a label on the browsegallery page and I would like for it to say "Yes" or "No" based on if the boolean choice was True or False. (Yes, No).

 

However, I have tried multiple version of code and none add anything to the label. Here is the current code im adding to the Text field: 
If(
DataCardValue7.text = true,
"Yes",
DataCardValue7.text = false,
"No"
)

 

Ive tried multiple rearrangements of this including .value, datacardvalue7, etc.

 

Any help would be greatly appreciated.

Categories:
  • Ethan_009 Profile Picture
    4,840 Moderator on at

    Hi @lier_bag20 ,

     

    Have you tried this,

    If(
     DataCardValue7.text = true,
     "Yes",
     "No"
    )

     

    Hope this helps

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @lier_bag20 

    deleted

     

  • lier_bag20 Profile Picture
    22 on at

    Hey @Ethan_R , I tried that way first, but it does not work. Error says, "Incompatible types for comparison. These types can't be compared: error, Boolean."

    Would it matter if my Booleon datacard was a drop down?


  • Verified answer
    Ethan_009 Profile Picture
    4,840 Moderator on at

    Yes @lier_bag20 ,

     

    If you have a dropdown control then your formula will be different.

    If(
     dropdown.Selected.Value = true,
     "Yes",
     "No"
    )
    

     

    Here, dropdown is your control.

    1. It will be datacard if the field created is a option set by default

    2. if its boolean and you manually added control as dropdown then make sure you attach the control to the data-field on the form. So any changes on the dropdown will ensure data change on the form as well.

     

    Note: If your dropdown has string values of 'True' and 'False', then compare with string else boolean would work fine.

     

    Hope this helps

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 204 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard