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
Dual Super User
Dual 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
Dual Super User
Dual 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
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,304)