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 / Power Apps If Else sta...
Power Apps
Answered

Power Apps If Else statement in visible formula depending on two or more different dropdown values

(1) ShareShare
ReportReport
Posted on by 517

Hi,

 

I what is the right formula when I want to be visible a certain field. Here's my sample:

 

Dept Head- will be visible based on values from two different dropdowns (Request Type and Group)

 

Department Head will only show up if these values are met. 

 

Request TypeGroup
Request_1Group1
Request_1Group2
Request_1Group3
Request_1Group4
Request_2Group1
Request_2Group2
Request_2Group3

 

Meaning if I select Request Type = Request_2 and Group = Group4 the Department Head will not be visible.

 

Here's my formula.. 

 

If(
DataCardValue5.Selected.Value = "Request_1" And DataCardValue10.Selected.Result = "Group1" Or DataCardValue10.Selected.Result = "Group2" Or DataCardValue10.Selected.Result = "Group3" Or DataCardValue10.Selected.Result = "Group4" Or

 

DataCardValue5.Selected.Value = "Request_2" And
DataCardValue10.Selected.Result = "Group1" Or DataCardValue10.Selected.Result = "Group2" Or DataCardValue10.Selected.Result = "Group3",

true,
false
)

Categories:
I have the same question (0)
  • ganeshsanap Profile Picture
    1,554 on at

    @InfoUCS 

     

    What if there are more options like "Request_3", "Request_4", "Request_5" for Request Type & "Group5", "Group6", "Group7" and so on?

     

    @jaina wants to make Dept Head visible only for specific set of values.

     

    Your formula will evaluate to true & create problems when Request Type is equal to "Request_4" & Group is equal to "Group7" by making the field visible (which is the not desired result).


    Please click Accept as solution & ‌‌👍 if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

  • InfoUCS Profile Picture
    23 on at

    Hi @ganeshsanap and @jaina.

    The visible property is ONLY checking for a true or false condition so based on @jain 's request my code should work. Besides compare the lines of code provided vs my 1 line... #LessIsMore

     

  • jaina Profile Picture
    517 on at

    Hi @InfoUCS ,

     

    yes actually there are more options that the Department Head should not be visible

    I just not included those options to this sample, anyway thanks as well

  • ganeshsanap Profile Picture
    1,554 on at

    @InfoUCS 

    What if there are more options for Request Type & Group Or if more options added later to these fields?

     

    It's better to write conditions based on required values for safer side.


    Please click Accept as solution & ‌‌👍 if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

  • InfoUCS Profile Picture
    23 on at

    How about simplifying the visible property like this:

    !(DataCardValue5.Selected.Value = "Request_2" And DataCardValue10.Selected.Result = "Group4")

  • Verified answer
    ganeshsanap Profile Picture
    1,554 on at

    @jaina Use this formula:

     

     

    If(
    	Or(
    		And(
    			DataCardValue5.Selected.Value = "Request_1",
    			Or(
    				DataCardValue10.Selected.Result = "Group1",
    				DataCardValue10.Selected.Result = "Group2",
    				DataCardValue10.Selected.Result = "Group3",
    				DataCardValue10.Selected.Result = "Group4"
    			)
    		),
    		And(
    			DataCardValue5.Selected.Value = "Request_2",
    			Or(
    				DataCardValue10.Selected.Result = "Group1",
    				DataCardValue10.Selected.Result = "Group2", 
    				DataCardValue10.Selected.Result = "Group3"
    			)
    		)
    	),
    	true,
    	false
    )

     


    Please click Accept as solution & ‌‌👍 if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

  • Verified answer
    jaina Profile Picture
    517 on at

    I just figured this out. For those who has the same requirement, here's the working formula I made based on my example:

     

    If(
    DataCardValue5.Selected.Value = "Request_1" And DataCardValue10.Selected.Result = "Group1" Or DataCardValue10.Selected.Result = "Group2" Or DataCardValue10.Selected.Result = "Group3" Or DataCardValue10.Selected.Result = "Group4"

     

    &&

     

    DataCardValue5.Selected.Value = "Request_2" And
    DataCardValue10.Selected.Result = "Group1" Or DataCardValue10.Selected.Result = "Group2" Or DataCardValue10.Selected.Result = "Group3",

    true,
    false
    )

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…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 400

#2
WarrenBelz Profile Picture

WarrenBelz 348 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 315 Super User 2025 Season 2

Last 30 days Overall leaderboard