cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

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)
Entity data as shown in web.powerapps.com entity data viewEntity 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
Advocate II
Advocate II

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?

Highlighted
Community Support
Community Support

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

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?

Highlighted

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (8,636)