# Event Helper Functions

### Journey step data

To access event data used in a realtime journey, you should use the following syntax in your realtime messages:

```jsx
{{journey.steps.[0].[properties.***]}}
```

`0` in `journey.steps.[0]` refers to the first event in a user journey defined in your real-time campaign. If you replace 0 with 1, this will refer to the second one.

`***` is the placeholder which must be replaced with the name of the event attribute that you would like to access. e.g. `url`, `customProperty`, `total`.

The easiest way to find out what properties are available to use, you can use CrossEngage's segmentation engine which allows you to easily see all of your events and their properties.

### Story step data

Similar to the journey step data, you can also pull data from steps taken by a User in a Story. It has the following syntax:

```
{{story.blocks.[0].[properties.***]}}
```

### Historical event data

While the `#includeProducts` helper function is primarily used to access product information, it may also be used to access event data from historical events:

```jsx
{{#includeProducts '{
    "eventProducts": {
        "events": ["Viewed Product"],
        "eventTimes": ["-2 weeks","now"],
        "operator": "n-th last",
        "operand": 1
        }
    }
'}}
{{[properties.image]}}
{{/includeProducts}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.crossengage.io/data-and-engagement-platform/messages/personalization/misc.-helper-functions/event-helper-functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
