你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
tobool()
Applies to: ✅ Microsoft Fabric ✅ Azure Data Explorer ✅ Azure Monitor ✅ Microsoft Sentinel
Convert inputs to boolean (signed 8-bit) representation.
The
tobool()
andtoboolean()
functions are equivalent
Note
When possible, use bool literals instead.
Syntax
tobool(
value)
Learn more about syntax conventions.
Parameters
Name | Type | Required | Description |
---|---|---|---|
value | string |
✔️ | The value to convert to boolean. |
Returns
If conversion is successful, result will be a boolean.
If conversion isn't successful, result will be null
.
Example
tobool("true") == true
tobool("false") == false
tobool(1) == true
tobool(123) == true