> ## Documentation Index
> Fetch the complete documentation index at: https://docs.farmtrace.co.za/llms.txt
> Use this file to discover all available pages before exploring further.

# Formula Contexts

Most formulas need only the values you pass to them. A smaller group reads information supplied by the screen or workflow where the formula runs.

| Context       | Functions                                                                            | What must be available                                     |
| ------------- | ------------------------------------------------------------------------------------ | ---------------------------------------------------------- |
| Current time  | `Today`, `Now`                                                                       | The formula evaluation time and timezone.                  |
| Session       | `AppId`, `TableId`, `RecordId`, `User`, `Role`, `URL`, and related session functions | An active Dsync/TeamDesk session snapshot.                 |
| Device        | `DeviceLatitude`, `DeviceLongitude`, `DeviceLocation`, `DeviceTimestamp`             | A captured device location and timestamp.                  |
| HTTP response | `Response`, `ResponseHeader`, `ResponseStatus`                                       | A response captured by the current integration step.       |
| File          | `FileName`, `FileType`                                                               | A file attachment value.                                   |
| Prompt        | `Ask`, `Parameter`                                                                   | Parameter definitions and any values supplied by the user. |

<Warning>
  A context function that needs a concrete snapshot fails clearly when that snapshot is unavailable. For example, `ResponseStatus()` cannot run on a normal calculated field that has no captured HTTP response. Functions whose entries describe an optional value, such as `ParentKey()`, can return `null` instead.
</Warning>

## Device values

The four device functions use one captured snapshot. This keeps latitude, longitude, location, and timestamp consistent within the same evaluation.

Use them in workflows that capture device data, such as submission-time location recording:

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
DeviceLocation()
```

## Response values

Use response functions after a workflow has captured an HTTP response:

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
If(ResponseStatus() >= 200 and ResponseStatus() < 300,
   Response("data.reference"),
   "Request failed")
```

`Response()` returns the raw body. A path can extract JSON or XML data, and an optional result type can convert it. See [Special functions](/reference/special#response).

## Session values

Session functions help identify the current database, table, record, user, role, browser class, and URL. Use them for labels, routing, permissions-aware presentation, and integration payloads—not as a replacement for server-side access control.

## Prompt values

`Parameter` declares or reads a prompt value. `Ask` checks whether required inputs are still missing and evaluates its condition after they are supplied. See [Ask and parameter functions](/reference/ask).
