cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Xiangchen_2019
Helper I
Helper I

how to handle Boolean value in Datatable

Hi,

 

I have a datatable connect to DB table. this table has two columns, which is 1 or 0. I have choose checkbox to show this boolean value in the datatable. but the checkbox has been checked no matter the value is 1 or 0.

 

Please advise how to make the checkbox is checked only for the 1 value.

 

Thanks,

 

Xiang

see screenshot:

 

datatable - PowerApps.png

 

 

15 REPLIES 15
JamesThurber
New Member

I came across the same issue @Xiangchen_2019 & @mdevaney .  Every checkbox in the datatable was checked even when it should have been unchecked.  I played with the functions and still didn't like the results.  Then I accidentally deleted the Text field for the column and the checkboxes are filled accurately now.

 

So to get the checkboxes in the column to react correctly to a boolean value just remove the Text value for the column.

Xiangchen_2019
Helper I
Helper I

@JamesThurber Got it. Thank you. Xiang

Deleting the Text formula worked for me. 

 

 

Yes, @JamesThurber is 100% correct. Select the column with the boolean values (where all checkboxes are shown as selected), then remove the formula within the text property of this column (mine was ThisItem.XY), 

__aboot_0-1609939900858.png

Then you achieve also displaying empty checkboxes.
(Maybe seen from a logical standpoint, the datatable only checks if there is a value, which is with regards to boolean always the case (true/false or yes/no are values vs. NULL, which is not a value).)
So after removing the formula it works as intended.

__aboot_1-1609940965391.png

 

AlvaroYurrita
Regular Visitor

I just stumbled into this same problem. Select the column, and on the Text property you probably have a residual: ThisItem.'Has attachments'. This will trigger the checkbox to be selected all the time, no matter the font.  Simple delete all the contents of the Text property, and the checkbox will work correctly

Anonymous
Not applicable

Really, this is acceptable to need to create an If statement with unicode characters?  To me it's a bug.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,229)