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

How to differentiate beween 0 and Blank()?

Hello,

 

I have a solution I'm working on which has a couple of fields that use the decimal data type (CDS for apps).
This field is not required so can be left as Blank() to show that there is no data.  However, a data value of 0 is significant in this case so I need to be able to display if there's a value of 0 as well as "No value".

The app appears to save the data correctly (Blank gets saved as Blank, 0 gets saved as 0), but I can't get it to visually indicate this to the user on the form.

I have been testing in-app using Blank(), Text(), and Value(), but they all consider a value of 0 to be equivalent to Blank().  When I look in the CDS Entity data however, it clearly distinguished between a value of 0 and Blank.

Consider this test: 
CalibrationFactorStart is equal to Blank()
CalibrationFactorFinish is equal to 0.00

Both these values are verified by checking the record in CDS (see screenshot)
CDS Data.PNGEntity data as shown in web.powerapps.com entity data view
In my testing I've attempted to see if I can get PowerApps to distinguish between Blank() and 0 using this equation while viewing the same record in a form (text output to a label):

"CFS IsBlank: " & IsBlank(SelectedLpgCalibration.'Calibration Factor Start') & "
CFS - Value: " & Value(SelectedLpgCalibration.'Calibration Factor Start') & "
CFS = 0: " & (SelectedLpgCalibration.'Calibration Factor Start' = 0) & "
CFS to Text: " & Text(SelectedLpgCalibration.'Calibration Factor Start', "[$-en-US]#.##") & "

CFF IsBlank: " & IsBlank(SelectedLpgCalibration.'Calibration Factor Finish') & "
CFF - Value: " & Value(SelectedLpgCalibration.'Calibration Factor Finish') & "
CFF = 0: " & (SelectedLpgCalibration.'Calibration Factor Finish' = 0.00) & "
CFF to Text: " & Text(SelectedLpgCalibration.'Calibration Factor Finish', "[$-en-US]#.##")

and here's the output...none of these methods distinguish between 0 and Blank():
(CFS = Calibration Factor Start, CFF = Calibration Factor Finish)
Output.PNG
Based on my test there is no way I can determine to distinguish between 0 and Blank().
Anyone have any insights or workarounds for this problem?

4 REPLIES 4
Highlighted
AccuFloDev
Level: Powered On

How to differentiate between 0 and Blank()?

Hello,

 

I have a solution I'm working on which has a couple of fields that use the decimal data type (CDS for apps).
This field is not required so can be left as Blank() to show that there is no data.  However, a data value of 0 is significant in this case so I need to be able to display if there's a value of 0 as well as "No value".

The app appears to save the data correctly (Blank gets saved as Blank, 0 gets saved as 0), but I can't get it to visually indicate this to the user on the form.

I have been testing in-app using Blank(), Text(), and Value(), but they all consider a value of 0 to be equivalent to Blank().  When I look in the CDS Entity data however, it clearly distinguished between a value of 0 and Blank.

Consider this test: 
CalibrationFactorStart is equal to Blank()
CalibrationFactorFinish is equal to 0.00

Both these values are verified by checking the record in CDS (see screenshot)
CDS Data.PNGEntity data as shown in web.powerapps.com entity data view
In my testing I've attempted to see if I can get PowerApps to distinguish between Blank() and 0 using this equation while viewing the same record in a form (text output to a label):

"CFS IsBlank: " & IsBlank(SelectedLpgCalibration.'Calibration Factor Start') & "
CFS - Value: " & Value(SelectedLpgCalibration.'Calibration Factor Start') & "
CFS = 0: " & (SelectedLpgCalibration.'Calibration Factor Start' = 0) & "
CFS to Text: " & Text(SelectedLpgCalibration.'Calibration Factor Start', "[$-en-US]#.##") & "

CFF IsBlank: " & IsBlank(SelectedLpgCalibration.'Calibration Factor Finish') & "
CFF - Value: " & Value(SelectedLpgCalibration.'Calibration Factor Finish') & "
CFF = 0: " & (SelectedLpgCalibration.'Calibration Factor Finish' = 0.00) & "
CFF to Text: " & Text(SelectedLpgCalibration.'Calibration Factor Finish', "[$-en-US]#.##")

and here's the output...none of these methods distinguish between 0 and Blank():
(CFS = Calibration Factor Start, CFF = Calibration Factor Finish)
Output.PNG
Based on my test there is no way I can determine to distinguish between 0 and Blank().
Anyone have any insights or workarounds for this problem?

Community Support Team
Community Support Team

Re: How to differentiate beween 0 and Blank()?

Hi @AccuFloDev,

 

I think the issue here should be related to the "NULL" determine methods within PowerApps.

Based on the steps listed, it seems currently PowerApps itself could only have the "NULL" value from the data source treated as "0", not the "NULL".

 

The online document indicates that PowerApps is still pending on a fix for patching the "Null" values, see:

"

Note

At this time, storing blank values is supported only for local collections. We know that many data sources support blank (NULL) values, and we're working to lift this limitation.

"

The implementation for "NULL" support may still need some time, as this would require more investigation regarding the bottom Data Engine support.

@GregLi should be more specific on this, if it is convenient, would you( @GregLi )please share more details on this topic.

 

Best regards,

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

Re: How to differentiate beween 0 and Blank()?

Hey @v-micsh-msft,

 

I think I read the same thing on a PowerApps Blog post shortly after posting this question.
I attempted playing with this using the experimental connector for CDS, but it introduced a new issue:  (As far as I can tell) You cannot determine a records' owner with the experimental connector.  The column no longer exists once I turn it on.  Instead there's an "Owner" data source but I have no idea how to utilize it.

This is an issue because it prevents me from filtering data against the signed in user.
Do you happen to know how to determine record ownership with the CDS for Apps experimental connector?

Community Support Team
Community Support Team

Re: How to differentiate beween 0 and Blank()?

Hi @AccuFloDev,

 

I am also having issues working with the "Lookup" type field in CDS for Apps.

I will keep testing on this, and share the results if there are anything helpful.

Some information about CDS for Apps field type:

Type of fields

 

Best regards,

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 148 members 3,073 guests
Please welcome our newest community members: