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

# last_watched_lessons

> The last_watched_lessons list contains the ID of the last lessons watched by the current user, ordered by most recent

You can use the `last_watched_lessons` list in conjunction with <a href="/en/members-area/reference/objects/all_lessons">all\_lessons</a> object to create a "continue watching" or "recommended content" section.

## Syntax

```liquid theme={null}
{% last_watched_lessons.first %}
```

## Scope

It's accessible globally, in any template, section or block.

<Frame>
  ```mermaid theme={null}
  graph TD
      A[Global Context] --> B[last_watched_lessons]
      style A fill:#f9f9f9,stroke:#333,stroke-width:2px,color:#333,stroke-dasharray: 5 5
      style B fill:#4B96FF,stroke:#333,stroke-width:1px,color:white,font-weight:bold
      linkStyle 0 stroke:#4B96FF,stroke-width:2px
  ```
</Frame>

## Example

<Columns cols={2}>
  <CodeGroup>
    ```liquid Code theme={null}
    {% for lesson in last_watched_lessons %}
      {% assign lesson_data = all_lessons[lesson] %}
      - {{ lesson.name }}
    {% endfor %}
    ```

    ```json Data theme={null}
    // Just an example initial data, the data is not real
    {
      "all_lessons": {
        "lesson-a": {
          "name": "Introduction"
        },
        "lesson-b": {
          "name": "Advanced Course Intro"
        }
      }
      "last_watched_lessons": [
        "lesson-a",
        "lesson-b"
      ]
    }
    ```
  </CodeGroup>

  <CodeGroup>
    ```liquid Output theme={null}
    - Introduction
    - Advanced Course Intro
    ```
  </CodeGroup>
</Columns>
