---
schema_version: "1"
id: 3e78aabbbe2c68b7f91b9cf7240c9e3784e69457b12037d01df7288913c23067
title: toBoolean
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.5/dw-coercions-functions-toboolean.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.5/dw-coercions-functions-toboolean
source_site: docs.mulesoft.com
content_type: documentation
content_hash: d6df0aa1fb1f70481aaccaf076ce2c545a4eb469859049fd4177611f64dd4f3a
description: MuleSoft Documentation Site
release: "2.5"
latest: false
---
# toBoolean

## [](#toboolean1)toBoolean(str: String): Boolean

`String`​ 値を ​`Boolean`​ 値に変換します。

_DataWeave バージョン 2.4.0 で導入されました。_

### [](#パラメーター)パラメーター

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 25%;">
<col style="width: 75%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">名前</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>str</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>Boolean</code>​ 値に変換する ​<code>String</code>​ 値。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、さまざまな入力での ​`toBoolean`​ の動作を示します。

#### [](#ソース)ソース

```DataWeave
%dw 2.0
import * from dw::util::Coercions
output application/json
---
{
  a: toBoolean("true"),
  b: toBoolean("false"),
  c: toBoolean("FALSE"),
  d: toBoolean("TrUe")
}
```

#### [](#出力)出力

```Json
{
  "a": true,
  "b": false,
  "c": false,
  "d": true
}
```