Skip to main content
All CollectionsConnect your databases
Display boolean values on Database widgets
Display boolean values on Database widgets

A workaround that converts the boolean into a string using the CASE statement.

Updated over 2 years ago

Our Database data source doesn't support the boolean field. However, there is a way around this by converting the boolean into a string using the CASE statement.

In this SQL query example, profile_completed is the boolean.

SELECT email, profile_completed, created_at FROM users
ORDER BY created_at DESC

As we don't support the boolean field, using the same query in Geckoboard won't work. A table widget with these columns will display profile_completed as a blank column.

As a workaround, we can convert the boolean into a string using the CASE statement:

SELECT email, created_at,
CASE profile_completed
When True
Then 'True'
Else 'False'
END AS profile_completd
FROM users
ORDER BY created_at DESC

A table widget will now include the values in the profile_completed column.

Did this answer your question?