> 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/screen-flow-or-record-triggered-flow.md).

# Screen flow or record-triggered flow: recordId vs $Record

Screen flow or record-triggered flow: which one fits the job, why {!$Record} does not work in a screen flow, and how to use recordId instead.

You copied `{!$Record.Name}` from a record-triggered flow into a screen flow, and it is not there. The two flow types get their record in different ways. This page helps you pick the right type for the job, then moves `{!$Record}` logic into a screen flow.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FPd90lkm7j7SvmE29KXuT%2Frecordid-screen-flow-or-record-triggered-flow-result.png?alt=media" alt="Salesforce New Automation dialog opened from New Flow, showing Screen Flow and Record-Triggered Flow side by side, the two ways a flow gets its record" width="375"><figcaption><p>Two flow types, two ways to get the record.</p></figcaption></figure>

## Which one fits the job

|                               | Screen flow                                                      | Record-triggered flow                                    |
| ----------------------------- | ---------------------------------------------------------------- | -------------------------------------------------------- |
| Starts when                   | A user opens it: on a record page, from a Quick Action, a button | A record is created, updated or deleted                  |
| Shows screens to the user     | Yes                                                              | No, it runs in the background                            |
| Gets the record as            | The `recordId` input variable: the Id only                       | `{!$Record}`: the whole record, every field              |
| Avonni Flow Screen Components | Yes, on its screens                                              | No, there are no screens                                 |
| Example                       | An agent opens an Account and logs a visit                       | A Case's priority is set to High when its type is Outage |

Pick the screen flow when a person has to see, choose or type something. Pick the record-triggered flow when the work must happen every time a record is saved, whoever saves it.

## Why {!$Record} does not work in a screen flow

`{!$Record}` is the record whose change started a triggered flow. A screen flow is started by a person, not by a record change, so there is no `$Record` to read. The record comes in through `recordId`, and only as an Id. To read its fields, load the record with Get Records.

## Steps

{% stepper %}
{% step %}

### Add the recordId variable

Create a Text variable `recordId` with **Available for input** checked, and pass it from the page or a Quick Action. 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).
{% endstep %}

{% step %}

### Load the record

Add a **Get Records** element at the start, named `Get_Record`: the object of the page, filter `Id` Equals `{!recordId}`, **Only the first record**.
{% endstep %}

{% step %}

### Replace each {!$Record} reference

Wherever the record-triggered version used `{!$Record.Name}`, use `{!Get_Record.Name}`. Same for every field.
{% endstep %}

{% step %}

### Save and test

Debug the flow with a real record Id: the screens show that record's fields. See [Test a screen flow that needs a record Id](https://docs.avonnicomponents.com/flow/tutorials/tips-and-tricks/test-a-screen-flow-that-needs-a-record-id.md).
{% endstep %}
{% endstepper %}

## Do you need both?

Often, yes. The screen flow collects what the user decides and saves it with **Update Records**. That save is a record change, so any record-triggered flow on the object runs after it, as for any other edit. Keep the user's choices in the screen flow and the always-on rules in the record-triggered flow.

## 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 record page and the Quick Action.
* [Quickstart guide](https://docs.avonnicomponents.com/flow/getting-started/quickstart-guide.md): a screen flow with Avonni components, from a blank flow to the Account page.
* [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): use `recordId` without a Get Records.


---

# 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/screen-flow-or-record-triggered-flow.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.
