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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / When 2 columns in SP a...
Power Apps
Answered

When 2 columns in SP are "Yes", show a message if not don't

(1) ShareShare
ReportReport
Posted on by 570 Season of Giving Solutions 2025
Hi guys!
 
So I have 4 columns, 2 show raw text results and other 2 are yes or no type column. So I want when the 2 columns are Yes and Yes, it shows a text. This is the SP list:
So in this case the message won't be showing, but if Disponibilitat Principal & Disponibilitat Alternativa are both Yes, then show it:
What do I have to put in the Visible control from that text?
Categories:
I have the same question (0)
  • Suggested answer
    MS.Ragavendar Profile Picture
    5,761 Super User 2026 Season 1 on at
     
    If(
        ThisItem.'Disponibilitat Principal' = true &&
        ThisItem.'Disponibilitat Alternativa' = true,
        true,
        false
    )
     
    Please click Accept as solution if my post helped you solve your issue and help others who will face the similar issue in future.
    ❤️ Please consider giving it a Like, If the approach was useful in other ways.
    🏷️ Please tag me @MS.Ragavendar if you still have any queries related to the solution or issue persists.
  • WarrenBelz Profile Picture
    153,731 Most Valuable Professional on at
    Firstly @MS.Ragavendar is correct, so please mark that answer - a suggestion here that you can get rid of all the If/true/false parts as all elements are Boolean and translate directly, so the Visible can be
    ThisItem.'Disponibilitat Principal' && ThisItem.'Disponibilitat Alternativa'
    So if both are true, then so will be the visibility of the target control.
  • Charlie Martharper Profile Picture
    570 Season of Giving Solutions 2025 on at
    When trying both, it doesn't get the SharePoint column name right:
     
    This is the other one, it seems it doesn't get the columns from the SharePoint list?
    Am I missing something?
  • MS.Ragavendar Profile Picture
    5,761 Super User 2026 Season 1 on at
     
    Btw why you are giving label and can you please confirm how you are doing validations.
     
    To answer your question :-
     
    If you are using label control just give labelname.text.
     
    Please click Accept as solution if my post helped you solve your issue and help others who will face the similar issue in future.
    ❤️ Please consider giving it a Like, If the approach was useful in other ways.
    🏷️ Please tag me @MS.Ragavendar if you still have any queries related to the solution or issue persists.
  • Verified answer
    VASANTH KUMAR BALMADI Profile Picture
    195 on at

    In the Visible property of the text label, you just need to check that both Yes/No columns are true.

    Assuming your SharePoint Yes/No columns are:

    • Disponibilitat Principal

    • Disponibilitat Alternativa

    Use this formula:

    ThisItem.'Disponibilitat Principal' = true &&
    ThisItem.'Disponibilitat Alternativa' = true
    

    Or simply:

    ThisItem.'Disponibilitat Principal' &&
    ThisItem.'Disponibilitat Alternativa'
    

    Explanation

    • SharePoint Yes/No columns return Boolean values in Power Apps

      • Yes → true

      • No → false

    So the text will be visible only when both columns are Yes.

    If the label is outside a gallery or form

    Use the selected record instead:

    Gallery1.Selected.'Disponibilitat Principal' &&
    Gallery1.Selected.'Disponibilitat Alternativa'
    

    or

    Form1.Item.'Disponibilitat Principal' &&
    Form1.Item.'Disponibilitat Alternativa'
    

    Result

    Principal Alternativa Text Visible
    Yes Yes ✅ Yes
    Yes No ❌ No
    No Yes ❌ No
    No No ❌ No

    That’s all you need — no extra conditions required.

  • Charlie Martharper Profile Picture
    570 Season of Giving Solutions 2025 on at
    I tried that but it returns me this:
    3 erros:
    1. Name isn't valid. 'ThisItem' isn't recognized.
     
    2. Incompatible types for comparison. These types can't be compared: Error, Boolean.
     
    3. The '.' operator cannot be used on Error values
     
    This 3 errors when using that. 
     
    It's inside a container thet text and both columns are true in the SP list:
  • Kalathiya Profile Picture
    1,027 Super User 2026 Season 1 on at

    It depends on how your form is set up.

    If your Form Item is coming from a variable, then in the Visible property of the label you can check the columns from that variable, for example:
     
    Label Visible Property:
    g_SelectedItem.DisponibilitatPrincipal = "Yes" &&
    g_SelectedItem.DisponibilitatAlternativa = "Yes"
    
    //g_SelectedItem - user you variable instead of, also if column name is wrong please it with your column name
    If you’re not using a variable yet and you’re opening the form from a Gallery, then first store the selected record in Gallery - OnSelect:

    Gallery OnSelect Property: 

    Set(g_SelectedItem, Blank());
    Set(g_SelectedItem, ThisItem);
    

    If this doesn’t work, please share a bit more info so we can help better:

    #1. Are you using a Form control?

    #2. How are you binding the data to the form?

    #3. Please share a screenshot of the Form control’s Item property (if you’re using a form).

    If this response resolves your issue, please mark it as the Verified Answer so it can help other community members as well
    ---------------------------------------------------------------------------------
     
    📩 Need more help? Mention @Kalathiya anytime!
    ✔️ Don’t forget to Accept as Solution if this guidance worked for you.
    💛 Your Like motivates me to keep helping!
     
  • Charlie Martharper Profile Picture
    570 Season of Giving Solutions 2025 on at
     
    This is a text label, that only has to be shown when 2 columns in the sharepoint list (Yes/No) are both yes.
    The text is inside a container:
    I don't really know what to put in the g_SelectedItem.
    The list looks like this:
     
    If Visites disponibles shows 2 options, the text has to be visible:
    If there is only 1, it doesn't have to be visible:
    So that is what the columns Yes/No does, get if there are available or not, and if both are available, the text says "Select one of them".
     
  • Charlie Martharper Profile Picture
    570 Season of Giving Solutions 2025 on at
     
    It works what you said, from the gallery, thanks!
  • Charlie Martharper Profile Picture
    570 Season of Giving Solutions 2025 on at
     
    In the case that, the yes no column is yes, I want the code from the column text shows.
    If it's not selected, like if it's no, then don't show the code of the column VISITA XXXX
     
    I should create a conditional in the text label control visible right? How should it look?
    I have the container outside the gallery where the information comes, So I don't know what to add to get the information. That's why This item doesn't read it well.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 291 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 282 Super User 2026 Season 1

#3
VASANTH KUMAR BALMADI Profile Picture

VASANTH KUMAR BALMADI 195

Last 30 days Overall leaderboard