TO_BOOLEAN function

TO_BOOLEAN function

Function Name Description Usage Input parameter Return value
TO_BOOLEAN Converts a string to a boolean data type. TO_BOOLEAN() N/A A boolean. If a string has the value true or false, this function returns the corresponding boolean value.

Supported data type

The TO_BOOLEAN function supports the following data types:

  • JSON
  • String

Example 1: Get the boolean value of a string

Sample data: $var1$ = "true"

Usage: $var1$.TO_BOOLEAN()

Get the boolean value of var1.

Output: TRUE

Example 2: Get the boolean value of a string

Sample data: $var1$ = "FALSE"

Usage: $var1$.TO_BOOLEAN()

Get the boolean value of var1.

Output: FALSE

Recommendation

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年12月09日 UTC.