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

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
Highlighted
Power Apps
Power Apps

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
Highlighted
Community Support
Community Support

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.
Highlighted
Frequent Visitor

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.

Highlighted
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

Highlighted
Frequent Visitor

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?

Highlighted
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 ? 

Highlighted
Power Apps
Power Apps

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
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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