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

Logical operators 'And' and 'Not' error when selecting 'Format Text'

Expressions using the logical operators And and Not are returned with errors after selecting the Format Text function in the expression editor.

 

In the following example, And disappears and Not is concatenated with its next word.

Typed expression: AssignmentFooterDeleteIcon.Visible And Not IsBlank(AssignmentSelected.AssignmentDeleted) And Not IsBlank(AssignmentSelected)

after Format Text: AssignmentFooterDeleteIcon.VisibleNotIsBlank(AssignmentSelected.AssignmentDeleted)NotIsBlank(AssignmentSelected)

 

All other logical operator derivations—Or, ||, && and !—format correctly. However, it may be helpful to note that an unnecessary space is placed in front of Not after selecting Remove Formatting.

1 ACCEPTED SOLUTION

Accepted Solutions
Power Apps Staff CarlosFigueira
Power Apps Staff

Re: Logical operators 'And' and 'Not' error when selecting 'Format Text'

Thank you for reporting this issue. We've identified the problem and are working on a fix, which should be released soon.

View solution in original post

6 REPLIES 6
Community Support Team
Community Support Team

Re: Logical operators 'And' and 'Not' error when selecting 'Format Text'

Hi @lepaule,

 

Sorry but I would like to confirm that, did you mean you have below formula in the Visible property of an icon control?

And Not IsBlank(AssignmentSelected.AssignmentDeleted) And Not IsBlank(AssignmentSelected)

And PowerApps format the formula to below?

NotIsBlank(AssignmentSelected.AssignmentDeleted)NotIsBlank(AssignmentSelected)

I think your formula should be something like this:

Not(IsBlank(Dropdown1.SelectedItems)) And Not(IsBlank(Dropdown2.SelectedItems))

This formula means that only if both Dropdown1 and Dropdown2 controls are not blank, visible would become true.

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
lepaule
Level: Powered On

Re: Logical operators 'And' and 'Not' error when selecting 'Format Text'

Thanks for responding @v-monli-msft.

The code I pasted works (until I click on the Format Text button). The expression returns a boolean and it doesn't matter where the code is placed, as long as long as the property expects a boolean (I did not test them all, but I tried a few).

The code you responded with does not use the Not logical operator and instead uses the Not function.

I am not having a problem getting my solution to operate properly. The problem is inside the PowerApps coding interface (I am using Edge browser on Windows 10). When the And and Not operators are combined, and then the Format Text button is pressed, the And disappears and the Not is concatenated with the following text.

This formats correctly

TextInput1.Visible And TextInput2.Visible

And this (in the Visible property of a Check Icon; TextInput2.Visible=false),

TextInput1.Visible And Not TextInput2.Visible

Untitled1.png

becomes this

TextInput1.VisibleNotTextInput2.Visible

Untitled2.png

after clicking the Format Text button.

 

Now that I have been playing with this for a while, I see that the combined Or Not operation also does not format correctly. it compiles and functions correctly, but after hitting the Format Text button the Or disappears and the Not is concatenated with the following string.

This, which functions as expected,

TextInput1.Visible Or Not TextInput2.Visible

becomes

TextInput1.VisibleNotTextInput2.Visible

after clicking the Format Text button.

 

Just thought somebody might fix it.

Super User
Super User

Re: Logical operators 'And' and 'Not' error when selecting 'Format Text'

Hi @lepaule

 

You should try the shortcode :

And : &&

Or : ||

Not : !

 

TextInput1.Visible && TextInput2.Visible : if TextInput1 visible is true and TextInput2.Visible is true, return true

TextInput1.Visible && !TextInput2.Visible :  if TextInput1 visible is true and TextInput2.Visible is false, return true 

TextInput1.Visible || !TextInput2.Visible : TextInput1 visible is true or TextInput2.Visible is false, return true

 

Théo

lepaule
Level: Powered On

Re: Logical operators 'And' and 'Not' error when selecting 'Format Text'

Thanks for your time @tchin-nin.

Type the following into an appropriate property of a screen with the appropriate controls.

TextInput1.Visible || !TextInput2.Visible

and then click on the Format Text button.

On my editor, the double pipes disappear and look like this.

TextInput1.Visible!TextInput2.Visible

And that is just wrong...and does not work.

The combined && ! operation formats correctly. But this is beside the point. I click that Format Text button frequently and since I am a Visual Basic programmer, I often type And Not into logical expressions. It is an annoyance reformatting perfectly formatted code after the code editor formatted it incorrectly.

Plus the pipe button is way over on the right side of my keyboard in a far more inconvenient location than the O and R buttons.

Again, I am not looking for help. I am trying to report a bug. Am I in the wrong place?

Super User
Super User

Re: Logical operators 'And' and 'Not' error when selecting 'Format Text'

I think @v-monli-msft can help reporting this one to the PowerApps Team ? 

Power Apps Staff CarlosFigueira
Power Apps Staff

Re: Logical operators 'And' and 'Not' error when selecting 'Format Text'

Thank you for reporting this issue. We've identified the problem and are working on a fix, which should be released soon.

View solution in original post

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (6,958)