Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Answered

If statement isn't working

(0) ShareShare
ReportReport
Posted on by

Hello everyone.

 

I am develoing an app and I have an If statement that is not working. The If statement is on the DisplayMode function of the "Reservar" button.

 

 

If(
 Switch_ComedorStatus.Value = false & galleryAvailRoom.Selected.Título = "COMEDOR"; DisplayMode.Disabled;
 cbDeskSelect_2.Value = false; DisplayMode.Disabled; DisplayMode.Edit
)

 

 

 I just selected "COMEDOR" and the switch is in false value, but the button is still in DisplayMode.Edit:

Jose_D07_0-1611613248005.png

Please someone help me with this 😣

  • Verified answer
    v-xiaochen-msft Profile Picture
    on at
    Re: If statement isn't working

    Hi @Anonymous ,

     

    Please use "&&" instead of "&".

    "&&" means and

     

    You could try the following formula

    If(
    Switch_ComedorStatus.Value = false && galleryAvailRoom.Selected.Título = "COMEDOR"; DisplayMode.Disabled;
    cbDeskSelect_2.Value = false; DisplayMode.Disabled; DisplayMode.Edit
    )

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 85 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 65 Super User 2025 Season 1

#3
mmbr1606 Profile Picture

mmbr1606 55 Super User 2025 Season 1

Overall leaderboard