cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
southafrican
Level: Powered On

Have an error with the Or function

Hello 

 

I've been working on disabling a button when certain parameters are not meet in a form. Now this feature was working very well and then suddenly it stopped working and I am unsure why this is. The code I am using is - 

 

If (DataCardValue8.Text = "A" || "N" || "X" || "" , DisplayMode.Disabled, Edit)

 

This can also be seen in the photos below. 

 

As you can see I want it to disbale the submit button when the Text is A,N, X or blank. But it is only working when it is A and I've moved around the letters and it is only working for the first letter. Does anyone know why this is and how I can fix it? 

 

Capture1.PNGCapture2.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Have an error with the Or function

I don't think you can use OR using the syntax you are using.  The whole equation needs to be added to the OR.  Something like this.

If (DataCardValue8.Text = "A" || DataCardValue8.Text = "N" || DataCardValue8.Text = "X" || DataCardValue8.Text = "" , 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.

View solution in original post

1 REPLY 1
Super User
Super User

Re: Have an error with the Or function

I don't think you can use OR using the syntax you are using.  The whole equation needs to be added to the OR.  Something like this.

If (DataCardValue8.Text = "A" || DataCardValue8.Text = "N" || DataCardValue8.Text = "X" || DataCardValue8.Text = "" , 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.

View solution in original post

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Demo Extravaganza Championship Voting Open

Voting Ends: October 30, 2019!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 187 members 4,656 guests
Please welcome our newest community members: