# path

`path` navigates the user to another route, opens an external URL, or retargets an existing BetterForms window.

The old rule that "`path` must always be the last action" is too absolute for the current runtime.

What actually happens depends on which navigation mode you use.

| Key                | Type     | Description                                                                                                                                                                                                                                              |
| ------------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| action             | `"path"` | Action Name                                                                                                                                                                                                                                              |
| options.windowName | *string* | <p>{ optional } If specified, BetterForms updates the target card/modal window with the matching name instead of opening a normal route or URL navigation. This is useful when you want to retarget an existing BetterForms window.</p><p>ver 0.8.2+</p> |
| options.path       | *string* | { optional } Internal BetterForms route, for example `/`, `/dash`, or `/form/:id`.                                                                                                                                                                       |
| options.url        |          | { optional } External URL to open.                                                                                                                                                                                                                       |
| options.sameWindow |          | { optional } If true with `options.url`, BetterForms replaces the current browser tab instead of opening a new one.                                                                                                                                      |
| options.name       | *string* | Target name used by `window.open()` when opening an external URL. If omitted, BetterForms uses `_blank`. ( Ver 0.10.22+ )                                                                                                                                |
| options.features   | *string* | Window features as described in [MDN here](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#window_features). ( Ver 0.10.22+ )                                                                                                               |

## Runtime Behavior

| Mode                         | Key(s) used                        | What BetterForms does                 | Action thread continues? |
| ---------------------------- | ---------------------------------- | ------------------------------------- | ------------------------ |
| Internal route               | `options.path`                     | Calls the Vue router                  | Yes                      |
| External URL, new tab/window | `options.url`                      | Calls `window.open()`                 | Yes                      |
| External URL, same tab       | `options.url` + `sameWindow: true` | Replaces the current browser location | No                       |
| Existing BetterForms window  | `options.windowName`               | Updates the target BetterForms window | Yes                      |

For same-window external navigation, treat `path` as the last meaningful action because the browser is leaving the BetterForms app.

For internal routes and new-tab external links, the action queue can continue after navigation.

```json
{
  "action": "path",
  "options": {
    "path": "/invoiceList"
  }
}
```

```json
{
  "action": "path",
  "options": {
    "url": "https://docs.fmbetterforms.com/",
    "sameWindow": true
  }
}
```

```json
{
  "action": "path",
  "options": {
    "url": "https://example.com/report.pdf",
    "name": "_blank",
    "features": "noopener,noreferrer"
  }
}
```

## FileMaker Custom Function

```
BF_SetAction_Path("/form/123-1234-5678")
```


---

# 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://docs.klai.studio/reference/actions-processor/actions_overview/path.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.
