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.
Solved! Go to Solution.
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?
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.
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
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
after clicking the Format Text button.
Just thought somebody might fix it.
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
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.
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?
Check out the on demand sessions that are available now!
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Features releasing from October 2020 through March 2021
Check out the Power Platform Community Highlights