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

Boolean SharePoint fields can be NULL when tested in PowerApps

When a list in SharePoint has a field of type Boolean you must set its default value to either true or false. When a row to this list is added using the SharePoint interface, the field get indeed its default value as you would expect.

But when you add a row using PowerApps, and you don't specifically set the value to true or false, the value becomes Null (no value) in SharePoint.

This is critical when testing for this value in a PowerApp:

In SharePoint I defined the default to be false. The PowerApp added a row in SharePoint.

I assumed the value would have its default value so I tested the value using the if statement if it was false. To my surprise (and frustration I admid) this did not work. When I put a label in my app to see what value I tested against it said false! (big surprise!!) But the if statement did not evaluate this as false.

When I looked in SharePoint I saw there was no value for this field, the SharePoint default was not applied.

The solution in my usecase was to test for false or IsBlank this made things work.

But I think this is not the way it is supposed to work or am I wrong?

Best regards,

Bart Schaap

Wortell

 

4 REPLIES 4
Community Support
Community Support

Hi @BartSchaap,

 

I have tested it on my side that creates a Yes/No type of value( its return value as Boolean ), then creates a PowerApp not to set the value( its default value is 'No'--false ). Then I check it in the SharePoint and find the value is 'No', not happen the issue you described.Annotation 2019-08-30 110232.png

 

Annotation 2019-08-30 110856.png

What's the column type are you testing?

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

The value I am testing is a boolean value.

But your test is not as I described it. To reproduce delete the TestForBoolean datacard from the screen, than add a record a see what happens in SharePoint.

@v-litu-msft  any update on this?


@BartSchaap wrote:

The value I am testing is a boolean value.

But your test is not as I described it. To reproduce delete the TestForBoolean datacard from the screen, than add a record a see what happens in SharePoint.


 

Hi @BartSchaap,

 

Sorry for reply late. The column TestForBoolean I test in the SharePoint is a Yes/No type, the return value is Boolean.

Could you please share your column and PowerApps configuration?

Best Regards,
Community Support Team _ Lin Tu
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!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Users online (3,021)