> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/flow/tutorials/tips-and-tricks/test-a-screen-flow-that-needs-a-record-id.md).

# Test a screen flow that needs a record Id

Debug a screen flow that needs a recordId: paste a record Id in Flow Builder, run it from the record page, and see why it is blank from Setup.

You built a flow for the Account page, pressed **Run** in Flow Builder, and every screen came back empty. Nothing is broken: there was no record to pass. Here you test the flow with a real record Id, then on the page itself, and guard it against the empty case.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FAohyUV6WiwZtkjtxQi1i%2Frecordid-test-a-screen-flow-that-needs-a-record-id-result.png?alt=media" alt="Debugging a screen flow in Flow Builder with a recordId value: the Run Details show recordId set and the Get Records element finding the Account, beside the screen listing its three open Cases"><figcaption><p>Debug with a real Id: the screen and the debug details agree.</p></figcaption></figure>

## Before you start

* The flow has a Text input variable named `recordId`, with **Available for input** checked. See [How to pass your current RecordID in your screen flow](https://docs.avonnicomponents.com/flow/tutorials/tips-and-tricks/how-to-pass-your-current-recordid-in-your-screen-flow.md).
* You know one record that has data to show, for example an Account with a few open Cases.

## Steps

{% stepper %}
{% step %}

### Copy a record Id

Open the record in Lightning. Its Id is the part of the URL after the object name: in `/lightning/r/Account/001.../view`, copy the value that starts with `001`.
{% endstep %}

{% step %}

### Debug with that Id

In Flow Builder, click **Debug**. A panel opens on the left with a field for each input variable: paste the Id in the `recordId` field and click **Run**.

The flow's screen appears on the right, and the **Run Details** tab on the left shows what each element did. Check that your Get Records element found the record before you look at the screens.
{% endstep %}

{% step %}

### Run it on the record page

Activate the flow and open a record where it is placed (Flow component or Quick Action). This is the real test: it proves the page passes the Id, which Debug cannot.
{% endstep %}

{% step %}

### Guard against a missing Id

Add a **Decision** right after the Start element: `{!recordId}` **Is Null** `True` goes to a screen that says "Open this flow from an Account". Users who start the flow from the wrong place get a clear message instead of empty screens.
{% endstep %}

{% step %}

### Save and test

Debug once without a value: you reach the message screen. Debug again with the Id: the screens show that record's data.
{% endstep %}
{% endstepper %}

## Why it is blank when launched from Setup

`recordId` is only filled when something passes it: the **Pass record ID into this variable** checkbox, a Quick Action, or a value you type in Debug. **Run** in Flow Builder, the Flows list in Setup and a Flow component on a Home or App page pass nothing, so the variable stays empty. Then:

* Get Records filtered on `{!recordId}` finds nothing.
* An Avonni Data Table or Map with a query filter on `{!recordId}` shows no rows.
* An Avonni [Record Detail](https://docs.avonnicomponents.com/flow/flow-components/record-detail.md) with an empty **Record ID** switches to create mode and shows a blank form for a new record.

## Troubleshooting

<details>

<summary>Debug works, but the flow is empty on the record page</summary>

The page does not pass the Id. Check **Pass record ID into this variable** on the Flow component, and that the page you edited is the one assigned to your app and profile. For a Quick Action, the variable must be named exactly `recordId`.

</details>

<details>

<summary>The Debug panel has no recordId field</summary>

The variable is not marked **Available for input**. Edit it in the **Toolbox**, check the box, save, and open **Debug** again.

</details>

## Related tutorials

* [How to pass your current RecordID in your screen flow](https://docs.avonnicomponents.com/flow/tutorials/tips-and-tricks/how-to-pass-your-current-recordid-in-your-screen-flow.md): the variable and the two launch points.
* [Filter a Data Table or Map by the current record](https://docs.avonnicomponents.com/flow/tutorials/tips-and-tricks/filter-a-data-table-or-map-by-the-current-record.md): the components this test checks.
* [Screen flow or record-triggered flow](https://docs.avonnicomponents.com/flow/tutorials/tips-and-tricks/screen-flow-or-record-triggered-flow.md): when there is no record to pass at all.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.avonnicomponents.com/flow/tutorials/tips-and-tricks/test-a-screen-flow-that-needs-a-record-id.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
