cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BartSchaap
Level 8

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 Team
Community Support Team

Re: Boolean SharePoint fields can be NULL when tested in PowerApps

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.

BartSchaap
Level 8

Re: Boolean SharePoint fields can be NULL when tested in PowerApps

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.

BartSchaap
Level 8

Re: Boolean SharePoint fields can be NULL when tested in PowerApps

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


 

Community Support Team
Community Support Team

Re: Boolean SharePoint fields can be NULL when tested in PowerApps

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
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,555)