---
title: Referencing data
url: https://www.tines.com/docs/formulas/referencing-data/
updated: 2026-03-12T17:57:26+00:00
---

*[tines.com](https://www.tines.com/llms.txt) › [Docs](https://www.tines.com/llms.txt) › [Formulas](https://www.tines.com/llm/docs/formulas.md)*

# Referencing data

*[View on tines.com](https://www.tines.com/docs/formulas/referencing-data/)*

Formulas are all about referencing and transforming data. References can be derived from three locations:

1. Event data from an upstream action
2. Content of Credentials, Pages, Resources
3. Information about your environment 

## Reference data from upstream actions

Say we’re evaluating a formula's expression in **Action B**, which is downstream from **Action A**. Perhaps **Action A** had fetched a list of users from a remote API, i.e. Action A has produced an [event](/docs/events/#event-structure).

Now, **Action B** can make a reference to that data inside the event — for instance to count it:

```
COUNT(action_a.body.collections.users)
```

Simply refer to the [snake cased](https://en.wikipedia.org/wiki/Snake_case) name of the upstream action to access its data. Learn more [here](https://www.tines.com/docs/actions/configuration/config-events-and-values/). 

### Examples

**Receive email to HTTP Request** 

A "**Receive Email Action**" is connected to a downstream "HTTP Request Action". When an email is received, it produces an event which may look like:

```
{
  "receive_email_action": {
    "from": "potential_phishing@example.com",
    "subject": "Free gift cards",
  }
}
```

You can then put the sender's email in the downstream** **"HTTP Request Action" to check the sender domain:

```
# Access "Receive Email Action"'s sender email
receive_email_action.from

# It will produce
"potential_phishing@example.com"
```

**Page to record**

A page called "**Submit feedback**" is connected to a downstream "Capture record" tool. When the page is submitted, it produces an event containing the user's email and their feedback. The [page event](/docs/pages/collecting-input-with-forms/) may look like:

```
{
  "submit_feedback": {
    "body": {
      "feedback": "Sample feedback",
      "email": "user@example.com",
    }
}
```

You can then create a record by referencing the page's feedback in the "Capture record" tool:

```
# Access "Submit feedback"'s feedback
submit_feedback.body.feedback

# It will produce
"Sample feedback"
```



## Access data from credentials, pages, resources

Data stored in these three areas can be dynamically referenced at any time using the following keywords:

### From credentials

The `CREDENTIALS` key works identically to the previous example, for fetching [credential](/docs/credentials/) tokens. (Note: because these are inherently sensitive, we’ll never output a preview value in the formula builder when working with credentials.)

```
CREDENTIAL.example_api_key
```

If you want to dynamically reference credentials based on a variable, there are a couple of ways to do so:

```
# Upstream action payload
{
  credential_name: "example_api_key",
}

# Downstream functions
CREDENTIAL[upstream_action.credential_name]
GET(CREDENTIAL, upstream_action.credential_name)
```

### From pages

Use the special `PAGE` key to access all [Pages](/docs/pages) in the current [Story](/docs/story). If your current Story has a page tool named "**Get Email Updates**", then `PAGE.get_email_updates` will retrieve the [page's URL](/docs/pages/distribution-and-access-control/#customizing-the-url). 

```
# To access the "Get Email Updates" page in anywhere in your story:
PAGE.get_email_updates

# It will return the URL of that page:
"https://your-tenant.tines.com/pages/your_page_identifier"
```

### From resources

Use the special `RESOURCE` key to access data residing in [resources](/docs/resources). Let’s say we have a text resource **"Domain name"**. The following expressions would fetch it:

```
RESOURCE.domain_name
```

If you want to dynamically reference resources based on a variable, there are a couple of ways to do so:

```
# Upstream action payload
{
  resource_name: "domain_name",
}

# Downstream functions
RESOURCE[upstream_action.resource_name]
GET(RESOURCE, upstream_action.resource_name)
```



## Access information about your environment

Use the info, metadata, and paginate

### Info

The `INFO` key exposes relevant information about cases, credentials, resources, and records. 

**Credentials**: Access a credential's name, ID, and metadata values.

```
INFO.credential.example_credential_name.metadata.example_metadata_key
```

**Resources**: Access a resource's name and ID.

```
INFO.resource.example_resource_name.id
```

**Records**: Access a record's ID, name, and fields. For each field, access its ID and name.

```
INFO.record.example_record_name.fields.story_name.id
```

**Cases**: Access case sub-statuses and case fields within the team. 

- For each sub-status, view its ID and name.
- For each case field, view the ID, name, slug, markdown reference, type,  and validation options

```
INFO.cases.statuses.sub_status_name.id
INFO.cases.case_field_input_name.id
```

### Metadata

The `META` key exposes a useful set of information about the current environment. Here’s the full data structure it generates:

```json
"tenant": {
  "domain": "example.tines.com",
  "name": "example",
  "url": "https://example.tines.com"
},
"team": {
  "id": 123,
  "name": "Example team",
  "groups": {
    "case_group1": {
      "id": 12345,
      "name": "case group1"
    }
}
},
"story": {
  "id": 123,
  "name": "Example story",
  "key": "example_story",
  "is_draft": false,
  "draft": {
    "id": 12345,
    "name": "draft name"
  }
},
"action": {
  "id": 123,
  "name": "Example action",
  "key": "example_action"
},
"event": {
  "id": 123456789,
  "payload": {
    "array": [
      "the",
      "current",
      "payload",
      "being",
      "processed"
    ]
  }
}
"story_run": {
  "id": "fc7b6392-b602-465b-8f58-ee07d33fa80e"
}
```

So, for example, to access the name of the current story, you could use:

```
META.story.name
```

### Paginate

The `PAGINATE` key can be used in HTTP Request Actions with pagination enabled to access information about the pagination run.

**Index**: Returns the current index of the pagination loop, starting at 0 for the first page request.

```
PAGINATE.index
```

**Previous response**: Returns the HTTP response of the previous page. This is useful when you need to get a link to the next page or determine the total number of pages left. This value will be `null` for the first request.

```
PAGINATE.previous_response
```

Learn more about using `PAGINATE.index` and `PAGINATE.previous_response` in our [HTTP Request Action pagination guide](/docs/actions/types/http-request/#pagination).



## All formula keywords

Below is a list of all keywords you can reference when building a formula.

| Keyword | Description |  |
| --- | --- | --- |
| `CREDENTIAL` | Reference sensitive information without exposing its value |  |
| `FORM` | (Deprecated) Please use `PAGE` |  |
| `INFO` | Access metadata for [cases](https://www.tines.com/docs/cases/), [credentials](https://www.tines.com/docs/credentials/), [resources](https://www.tines.com/docs/resources/), and [records](https://www.tines.com/docs/records/) |  |
| `INPUT` | Access [action inputs](https://www.tines.com/docs/actions/templates/private-templates/#action-inputs) |  |
| `LOCAL` | Access data from the [local values](https://www.tines.com/docs/actions/configuration/#common-options) object |  |
| `LOOP` | Access data about the current [loop iteration](https://www.tines.com/docs/stories/groups/#looping). For each iteration of the loop, a `LOOP` object will be provided will contain: `value`, `index`, `key` and `previous_result` |  |
| `META` | Access data about the current environment including [looping page elements;](https://www.tines.com/docs/pages/looping-page-elements/) see above for full data structure |  |
| `OUTPUT` | Access the output of the action to modify the event data that it produces; see details on usage [here](https://www.tines.com/docs/actions/configuration/#common-options) |  |
| `PAGE` | Access the URL of a [page object](https://www.tines.com/docs/pages/) |  |
| `PAGINATE` | Used in HTTP Request Actions with [pagination](https://www.tines.com/docs/actions/types/http-request/#pagination) enabled to access information about the pagination run |  |
| `RESOURCE` | Access data from [Resources](https://www.tines.com/docs/resources/), which store information in a single, centralized location for your team |  |
| `STORY` | Used to get ID for [Send to Story](https://www.tines.com/docs/stories/send-to-story/) actions |  |
