---
schema_version: "1"
id: da1747d0a3cdffe4d45d26aabcc6ff3b78997b373f355d185fce9b579314b5aa
title: field
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.6/dw-values-functions-field.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.6/dw-values-functions-field
source_site: docs.mulesoft.com
content_type: documentation
content_hash: f51f94394a7d26334d4d1a2fc8e690a3ecd87c5d8692a87e8acf217261fc1777
description: MuleSoft Documentation Site
release: "2.6"
latest: false
---
# field

## [](#field1)field(namespace: Namespace | Null = null, name: String): PathElement

この関数は、​_オブジェクト項目_​を選択するために使用する ​`PathElement`​ データ型を作成し、型の ​`selector`​ 項目に特定の文字列を入力します。

`update`​ および ​`mask`​ 関数の一部のバージョンは、​`PathElement`​ を引数として受け入れます。

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

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

<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>namespace</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">選択する項目の名前空間。指定しない場合、null 値が設定されます。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>name</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">選択する属性の名前に設定する文字列。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、指定された名前空間 (​`ns0`​) のオブジェクト項目セレクターを作成し、セレクターの値を ​`"myFieldName"`​ に設定します。出力で ​`"kind"`​ キーの値が ​`"Object"`​ になっていることにも注意してください。

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

```DataWeave
%dw 2.0
output application/json
import * from dw::util::Values
ns ns0 http://acme.com/foo
---
field(ns0 , "myFieldName")
```

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

```Json
{
   "kind": "Object",
   "namespace": "http://acme.com/foo",
   "selector": "myFieldName"
 }
```