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 / Label Visibility with ...
Power Apps
Unanswered

Label Visibility with an If statement in a form viewer?

(1) ShareShare
ReportReport
Posted on by 52

Hello, 

 

I am attempting to add a label that would only show if a data card in my form viewer was set to "HS Approved". 

 

I  have tried ...

 

If(Gallery1_6.Selected),(DataCardValue16_1.Selected.Value = "HS Approved", true, false)

 

If((DataCardValue16_1.Selected.Value = "HS Approved"), true, false)

 

 

If((DataCardValue16_1.Text = "HS Approved"), true, false)

 

 

If(Value(DataCardValue16_1.Text) = " HS Approved", true, false)

 

& about a million variations of this but I cannot seem to get it to work. I have several labels set with a visibility if statement throughout my app but for some reason I am having trouble setting this one based on the info in the form viewer, any help would be appreciated! 

 

Categories:
I have the same question (0)
  • BideyYusuf Profile Picture
    387 on at

    Hello @kayakingaway First of all.... If the Datacardcontrol value you want to base the visibility of the Label on is a Text.... then on the visible property of the Label put:

    if(Datacardcontrol.Text = "HS Approved",true,false)

    but if the DatacardControl is a dropdown or combobox control.....you put.

    If(Datacardcontrol.selected.value = "HS Approved",true,false)

     

    let me know if this works for you

     

  • kayakingaway Profile Picture
    52 on at

    Hi! 

     

    Thanks for the suggestions. When I click on the field I am using it is listed as a Combo Box titled "DataCardValue16_1". I tried both of your suggestions and both gave me the "Incompatible types for comparison. These types can't be compared. I am thinking something needs to be different since it is displaying the form based on a gallery selection. 

     

     

    On initial entry into a normal form I have a formula...
    If((DataCardValue33.Selected.Value)= "HS Approved", true, false)

     

    & it works perfectly to only show the label when the HS Approved is chosen. But when I try to use a similar formula in the gallery/form viewer I get an error. 

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @kayakingaway 

    You never need an If() formula for a visible property since the equation reduces to true or false without it.  For example:  DataCardValue33.Selected.Value= "HS Approved" is either true or false.

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @kayakingaway 

    You never need an If() formula for a visible property since the equation reduces to true or false without it.  For example:  DataCardValue33.Selected.Value= "HS Approved" is either true or false.  You are making it unnecessarily complicated and introducing a source of error.

  • BideyYusuf Profile Picture
    387 on at

    Hi @kayakingaway On the form Viewer we might have to do it separately.

  • kayakingaway Profile Picture
    52 on at

    Hello, 

     

    Please see image. 

    ISSUE SNIPPIT.PNG
  • BideyYusuf Profile Picture
    387 on at

    @kayakingaway in this case, since FormViewer is display form, you will need to put the control on the Form Viewer separately. For example... if the DataCardValue16_1control is showing "HS Approved"

    On the visible property of the Datacard of the LabelText ...

    put the formula : DataCardValue16_1.Selected.Value = "HS Approved"

     

    Hope this clarifies it for you.

  • BideyYusuf Profile Picture
    387 on at

    Hi @kayakingaway  

    in this case, since FormViewer is display form, you will need to put the control on the Form Viewer separately. For example... if the DataCardValue16_1control is showing "HS Approved"

    On the visible property of the Datacard of the LabelText ...

    put the formula : DataCardValue16_1.Selected.Value = "HS Approved"

     

    Try this and let me know if it works for you.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 429 Most Valuable Professional

#2
11manish Profile Picture

11manish 191 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 122 Super User 2026 Season 2

Last 30 days Overall leaderboard