cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MadeToThink
Frequent Visitor

Struggling on expand a previous Power Apps required field based on (3) dropdown selections.

Power Apps Community,

 

Good day, I was successful getting support to establish a required field in my Power Apps form based on (2) dropdown value selections. I tried to expand the IF statement to other fields based on (3) dropdown value selections. It tests just fine in Power Apps, but when I launch it for use through our SharePoint, it does not work correctly. It activates as required no matter what is selected in DataCard Value8.

 

I was simply trying to have the team select either of the (2) specified software applications, the activity "Implementation" and finally the status "Completed." Based on these selected dropdown values it would make a date field required.

 

Can anyone possibly help me with understanding on what I did wrong. Below is the IF statement, I obviously did not do something correctly.  

 

If(DataCardValue7.Selected.Value = "Photoshop" || DataCardValue7.Selected.Value = "Illustrator" && DataCardValue8.Selected.Value = "Implementation" && DataCardValue10.Selected.Value="Completed", true, false)

 

Thank you all for any assistance you can provide on my issue with the IF statement.

2 ACCEPTED SOLUTIONS

Accepted Solutions
RandyHayes
Super User
Super User

@MadeToThink 

You are not expressly defining the boundaries of your And's and Or's.

Please consider changing your Formula to the following:

(DataCardValue7.Selected.Value = "Photoshop" || DataCardValue7.Selected.Value = "Illustrator") && 
DataCardValue8.Selected.Value = "Implementation" && 
DataCardValue10.Selected.Value="Completed"

 

Note: you don't need the extraneous If and true false part. The above already returns either true or false.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

NandiniBhagya20
Solution Sage
Solution Sage

Can you try adding below formula -

If((DataCardValue7.Selected.Value = "Photoshop" || DataCardValue7.Selected.Value = "Illustrator") && DataCardValue8.Selected.Value = "Implementation" && DataCardValue10.Selected.Value="Completed", true, false)


Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

View solution in original post

6 REPLIES 6
RandyHayes
Super User
Super User

@MadeToThink 

You are not expressly defining the boundaries of your And's and Or's.

Please consider changing your Formula to the following:

(DataCardValue7.Selected.Value = "Photoshop" || DataCardValue7.Selected.Value = "Illustrator") && 
DataCardValue8.Selected.Value = "Implementation" && 
DataCardValue10.Selected.Value="Completed"

 

Note: you don't need the extraneous If and true false part. The above already returns either true or false.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
NandiniBhagya20
Solution Sage
Solution Sage

Can you try adding below formula -

If((DataCardValue7.Selected.Value = "Photoshop" || DataCardValue7.Selected.Value = "Illustrator") && DataCardValue8.Selected.Value = "Implementation" && DataCardValue10.Selected.Value="Completed", true, false)


Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

MadeToThink
Frequent Visitor

Team,

 

Thank you both for your assistance. Both solutions presented above worked perfectly depending on which way you want to create the Power Apps statement for a required field based on (3) dropdown values. 

RandyHayes
Super User
Super User

@MadeToThink 

Yes, the main takeaway is that when you have Or's and And's in your formula, you will want to surround with parens the logic that you want.  Otherwise, the formula editor will assume the logic for you - which may not be right.

Also, as mentioned, there is no need for the If and true false statements.  It is redundant.  It is equivalent to If(true = true, true, false) - the formula already returns true or false.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
MadeToThink
Frequent Visitor

RandyHayes,

 

Thank you for teaching moment of this topic. Completely makes sense on what I was doing. Nothing like a little living & learning moment to enhance the Power Apps knowledge. Have a wonderful day!!

RandyHayes
Super User
Super User

@MadeToThink 

Yes, defining the logic specifically is always needed.

Makes me think of this joke:

Wife said to husband, “Buy a loaf of bread. If they have eggs, get a dozen.”

An hour later, the husband returned home with 12 loaves of bread. 
The wife got angry and asked, “Why did you get 12 loaves of bread?”.

He replied, “Because they had eggs.”
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (2,144)