---
title: "Formula - field: Read Log Event Field Values"
description: The field Formula function returns the value of a named Log Event field, such as MessageGUID, EventId, or LogDateTime. Includes the list of field names, syntax, and examples from the Field Values tab.
---

# :fa-function: Formula - Field

The `field` [Formula][] function returns the value of a named field of the [Log Event][], such as `MessageGUID` or `EventId`.

![Read the interchange id and then the MessageGUID of an Order-to-Cash event with field, animated walkthrough (7.12)][hero]  
*Animated walkthrough: with the Field Values of the logged Order Received event of order ORD-10005 in the [Order-to-Cash demo][], `field('ApplicationInterchangeId')` returns `PIC-20261115-1838-0005`, and `field('MessageGUID')` returns the id of the event's body part.*  

## :fa-code: Syntax

```text
field('fieldName')
```

### Parameters

|Parameter|Required|Description|  
|---|---|---|  
|`'fieldName'`|Yes|The name of the Log Event field, in single quotes, written exactly as in the table below (case-sensitive).|  

### Supported Field Names

These are the fields the **Field Values** tab of the test bench shows (see [Test Your Expression][]). They come from the details part of the Log Event; see [JSON Log Event - Details][] for how each one is set when you log.

|Name|Description|  
|---|---|  
|ApplicationInterchangeId|Id for the application scope|  
|EndPointDirection|The [Endpoint Direction][Endpoint Directions]|  
|EventDirection|The [Event Direction][EventDirections]|  
|EventId|Id of the event (GUID)|  
|LocalInterchangeId|Id for the local scope|  
|LogDateTime|The originating date and time of the Log Event|  
|MessageGUID|Id of the main body part (GUID)|  
|OriginalMessageTypeName|The name of the [Message Type][Message Types]|  
|TotalSize|Size in bytes|  

### Returns

The value of the named field as text, one value per Log Event.

## :fa-list-ol: Examples

### Example 1: Read the MessageGUID

#### Input

|Key|Value|  
|---|---|  
|EventId|77dcae21-8c28-ed11-8b59-00155d00b90d|  
|LogDateTime|2022-08-30T19:47:09.3663111+02:00|  
|MessageGUID|ca8e3ab5-7359-4726-a9ca-1f594a4190a1|  

#### Formula

```text
field('MessageGUID')
```

#### Result

```text
ca8e3ab5-7359-4726-a9ca-1f594a4190a1
```

![Test Expression tab, Field Values: field('MessageGUID') returns ca8e3ab5-7359-4726-a9ca-1f594a4190a1 (7.12)][1]  
*The value of the `MessageGUID` row in the Field Values tab is returned as the single match. The screenshot is the [Search Field][Search Fields] editor's Test Expression tab; the [Search Field Wizard][] Test step has the same tabs.*  

### Example 2: Read the EventId

#### Input

The Field Values of the same Log Event:

![Field Values tab listing the nine Log Event field names and their test values (7.12)][2]  
*The Field Values tab lists every field name you can pass to `field`, with the values of the test Log Event.*  

#### Formula

```text
field('EventId')
```

#### Result

```text
77dcae21-8c28-ed11-8b59-00155d00b90d
```

## :fa-circle-info: Notes

* `field` reads the fixed Log Event fields only. Use [context][Context] for Message Context properties and [body][] for the payload.
* Nest `field` in other functions like any other content, for example `substring(0, 10, field('LogDateTime'))` to keep the date part.

## :fa-hand-point-right: Next Steps

* :fa-magnifying-glass-plus: [Add or manage Search Field][]  
* :fa-flask: [Test Your Expression][]  
* :fa-hard-drive: [Add or manage Log View][]  

## :fa-link-horizontal: Related Topics

* :fa-envelope: [body][]  
* :fa-key: [context][Context]  
* :fa-tags: [contextKey][]  
* :fa-function: [Formula][]  
* :fa-scroll: [Formula language rules][]  
* :fa-puzzle-piece: [Search Field Expressions][]  
* :fa-envelope: [Log Event][]  
* :fa-wand-magic-sparkles: [Search Field Wizard][]  

[1]:{ndm}/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Source/FieldValueExample_MessageGUID.png
[2]:{ndm}/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Source/FieldValues.png

[Add or manage Log View]:{ndr}/Administration/1.%20Log%20Management/1.%20Log%20Views/Features/Add%20or%20Manage%20Log%20View.md
[Add or manage Search Field]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Add%20or%20manage%20Search%20Field.md
[body]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Source/body.md
[Context]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Source/context.md
[contextKey]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Source/contextKey.md
[Endpoint Directions]:{ndr}/Core%20Services/Log%20Event/Features/Endpoint%20Directions.md
[EventDirections]:{ndr}/Core%20Services/Log%20Event/Features/Event%20Directions.md
[Formula]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Overview.md
[Formula language rules]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Overview.md#fa-scroll-formula-language-rules
[hero]:{ndm}/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Source/Formula_Field.gif
[JSON Log Event - Details]:{ndr}/Core%20Services/Log%20Event/Features/JSON%20Log%20Event.md#details
[Log Event]:{ndr}/Core%20Services/Log%20Event/Overview.md
[Message Types]:{ndr}/Repository%20Model/Message%20Types/Overview.md
[Order-to-Cash demo]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/Generate-O2C-Demo-Data.md
[Search Field Expressions]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Overview.md
[Search Field Wizard]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Getting%20started/How%20to%20use%20the%20Search%20Field%20Wizard.md
[Search Fields]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/What%20is%20a%20Search%20Field.md
[Test Your Expression]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Add%20or%20manage%20Search%20Field.md#test-your-expression