You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're seeing some odd behavior in Power FX where a record member that hasn't yet taken on a value (so, it's Blank()) is not behaving as expected when we're using it in a Boolean context.
For example, we've got a conditional expression that returns true whenever both conditions are true (or truthy):
// gblSelectedPREntry is a record. has_guard is a 0 or 1, IsBlank() will be true or false(gblSelectedPREntry.has_guard&&IsBlank(gblSelectedPREntry.infopath_number))
When the app loads, the has_guard member of the gblSelectedPREntry has yet to be set, as it is set when a user clicks a checkbox. So, it returns Blank():
The infopath_number is also Blank(), so the IsBlank() returns true:
Our users figured out that if they toggle the checkbox where has_guard gets set to a 1 or 0, it starts behaving as expected.
So, before anything has been clicked, for some reason we're seeing true here instead of false:
Once the has_guard box is clicked, we see true, which is what we would expect:
If we uncheck has_guard, we see false, which is what we would have expected before checking the box, as well as after unchecking it:
The issue started a few days ago. Looking at your commit history, this looks like it adjusted your Type system: 2403e39. Maybe that's the culprit? Or are we misunderstanding how the Type system is supposed to work in Power FX on our side?
We're going to file an issue with our internal Power Apps Microsoft representatives as well, but I figured I'd reach out here in the meantime. To mitigate the issue in the short term, casting to Boolean when a value may be Blank() seems to work.
// This __always__ works(Boolean(gblSelectedPREntry.has_guard)&&IsBlank(gblSelectedPREntry.infopath_number))
If that's the expected behavior, please close this issue!
The text was updated successfully, but these errors were encountered:
We're seeing some odd behavior in Power FX where a record member that hasn't yet taken on a value (so, it's
Blank()
) is not behaving as expected when we're using it in a Boolean context.For example, we've got a conditional expression that returns
true
whenever both conditions are true (or truthy):When the app loads, the
has_guard
member of thegblSelectedPREntry
has yet to be set, as it is set when a user clicks a checkbox. So, it returnsBlank()
:The
infopath_number
is alsoBlank()
, so theIsBlank()
returns true:So, it would seem that this:
Should equal this:
But it doesn't!
Our users figured out that if they toggle the checkbox where
has_guard
gets set to a 1 or 0, it starts behaving as expected.So, before anything has been clicked, for some reason we're seeing
true
here instead offalse
:Once the
has_guard
box is clicked, we seetrue
, which is what we would expect:If we uncheck
has_guard
, we seefalse
, which is what we would have expected before checking the box, as well as after unchecking it:The issue started a few days ago. Looking at your commit history, this looks like it adjusted your Type system: 2403e39. Maybe that's the culprit? Or are we misunderstanding how the Type system is supposed to work in Power FX on our side?
We're going to file an issue with our internal Power Apps Microsoft representatives as well, but I figured I'd reach out here in the meantime. To mitigate the issue in the short term, casting to
Boolean
when a value may beBlank()
seems to work.If that's the expected behavior, please close this issue!
The text was updated successfully, but these errors were encountered: