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 Apps
Answered

Checkbox

(0) ShareShare
ReportReport
Posted on by 726

I have the below, and its not working as expected, 

 

If Datacardvalue73.Text = Leaver then i need all the below fields to not be blank 

 

if it is Monthly then i only need two of the fields to not be blank. 

 

 

If(
 (DataCardValue73.Text = "Leaver" &&

CB_Safety_No.Value = false && CB_Safety_Yes.Value = false Or
CB_Test_No.Value = false && CB_Test_Yes.Value = false Or
CB_Volt_No.Value = false && CB_Volt_Yes.Value = false Or
CB_Sniff_No.Value = false && CB_Sniff_Yes.Value = false 
)

||

(DataCardValue73.Text = "Monthly" &&
CB_Safety_No.Value = false && CB_Safety_Yes.Value = false Or
CB_Test_No.Value = false && CB_Test_Yes.Value = false )


, DisplayMode.Disabled, DisplayMode.Edit)

 

 

Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    Hi @amyharkus86 - if I understand correctly, you do not want to set fields to blank/not blank, but rather you want to modify the Display Mode property of a Form based on the value of multiple checkboxes?

  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    Hi @amyharkus86 ,
    You will have to write this code in Default property of the input controls (assuming controls are checkboxes/toggle as the value that you are trying to update is boolean).

    1. In Default value of CB_Volt_No, CB_Volt_Yes, CB_Sniff_No, CB_Sniff_Yes controls, try using below formula - 
    If(DataCardValue73.Text = "Leaver", false, true)

    2. In Default property of CB_Safety_No, CB_Safety_Yes, CB_Test_No, CB_Test_Yes control, use below formula - 
    If(DataCardValue73.Text = "Leaver" || DataCardValue73.Text = "Monthly", false, true)


  • mmollet Profile Picture
    3,187 on at

    You can try this:

     

    If(DataCardValue73.Text = "Leaver" And
    (
    (CB_Safety_No.Value = false && CB_Safety_Yes.Value = false) Or
    (CB_Test_No.Value = false && CB_Test_Yes.Value = false) Or
    (CB_Volt_No.Value = false && CB_Volt_Yes.Value = false) Or
    (CB_Sniff_No.Value = false && CB_Sniff_Yes.Value = false)
    ) Or
    DataCardValue73.Text = "Monthly" And
    (
    (CB_Safety_No.Value = false && CB_Safety_Yes.Value = false) Or
    (CB_Test_No.Value = false && CB_Test_Yes.Value = false)
    ),
    DisplayMode.Disabled,
    DisplayMode.Edit
    )

     

     

    Im not able to test this atm so let me know what it does and we will try to get you squared away. If you would rather use a swtich statement then you can do that and switch on the "leaver" and "monthly" and then do the if statements in the switch with the output in each as well.

  • Verified answer
    Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @amyharkus86, if I am reading this correctly, I think you're after the below pattern:

     

     

    Switch(
    
     DataCardValue73.Text,
    
     "Leaver",
    
     If(
    
     !CB_Safety_No.Value && !CB_Safety_Yes.Value || !CB_Test_No.Value && !CB_Test_Yes.Value || !CB_Volt_No.Value && !CB_Volt_Yes.Value || !CB_Sniff_No.Value && !CB_Sniff_Yes.Value,
    
     DisplayMode.Disabled,
    
     DisplayMode.Edit
    
     ),
    
     "Monthly",
    
     If(
    
     !CB_Safety_No.Value && !CB_Safety_Yes.Value || !CB_Test_No.Value && !CB_Test_Yes.Value,
    
     DisplayMode.Disabled,
    
     DisplayMode.Edit
    
     )
    
    )

     

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved.

    If you like my response, please give it a Thumbs Up.

     

  • mmollet Profile Picture
    3,187 on at

    I was lazy and said or you can use a switch statement in my post xD so thank you for this b/c I felt bad and was going to type this all out so my post would be "complete"! xD

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