---
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.
---

# <i class="fal fa-function" aria-hidden="true"></i> 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.*  

## <i class="fal fa-code" aria-hidden="true"></i> 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.

## <i class="fal fa-list-ol" aria-hidden="true"></i> 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
```

## <i class="fal fa-circle-info" aria-hidden="true"></i> 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.

## <i class="fal fa-hand-point-right" aria-hidden="true"></i> Next Steps

* <i class="fal fa-magnifying-glass-plus" aria-hidden="true"></i> [Add or manage Search Field][]  
* <i class="fal fa-flask" aria-hidden="true"></i> [Test Your Expression][]  
* <i class="fal fa-hard-drive" aria-hidden="true"></i> [Add or manage Log View][]  

## <i class="fal fa-link-horizontal" aria-hidden="true"></i> Related Topics

* <i class="fal fa-envelope" aria-hidden="true"></i> [body][]  
* <i class="fal fa-key" aria-hidden="true"></i> [context][Context]  
* <i class="fal fa-tags" aria-hidden="true"></i> [contextKey][]  
* <i class="fal fa-function" aria-hidden="true"></i> [Formula][]  
* <i class="fal fa-scroll" aria-hidden="true"></i> [Formula language rules][]  
* <i class="fal fa-puzzle-piece" aria-hidden="true"></i> [Search Field Expressions][]  
* <i class="fal fa-envelope" aria-hidden="true"></i> [Log Event][]  
* <i class="fal fa-wand-magic-sparkles" aria-hidden="true"></i> [Search Field Wizard][]  

[1]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Source/FieldValueExample_MessageGUID.png
[2]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Source/FieldValues.png

[Add or manage Log View]:https://docs.nodinite.com/administration/log-management/log-views/features/add-or-manage-log-view/
[Add or manage Search Field]:https://docs.nodinite.com/administration/log-management/search-fields/features/add-or-manage-search-field/
[body]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/source/body/
[Context]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/source/context/
[contextKey]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/source/contextkey/
[Endpoint Directions]:https://docs.nodinite.com/core-services/log-event/features/endpoint-directions/
[EventDirections]:https://docs.nodinite.com/core-services/log-event/features/event-directions/
[Formula]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/overview/
[Formula language rules]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/overview/#fa-scroll-formula-language-rules
[hero]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Admin/Log/Search%20Fields/Plugins/Formula/Source/Formula_Field.gif
[JSON Log Event - Details]:https://docs.nodinite.com/core-services/log-event/features/json-log-event/#details
[Log Event]:https://docs.nodinite.com/core-services/log-event/overview/
[Message Types]:https://docs.nodinite.com/repository-model/message-types/overview/
[Order-to-Cash demo]:https://docs.nodinite.com/repository-model/bpms/examples/order-to-cash/generate-o2c-demo-data/
[Search Field Expressions]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/overview/
[Search Field Wizard]:https://docs.nodinite.com/administration/log-management/search-fields/getting-started/how-to-use-the-search-field-wizard/
[Search Fields]:https://docs.nodinite.com/administration/log-management/search-fields/features/what-is-a-search-field/
[Test Your Expression]:https://docs.nodinite.com/administration/log-management/search-fields/features/add-or-manage-search-field/#test-your-expression