# Unlock content progressively

> Learn how to use local variables and conditions in PandaSuite to unlock screens based on user progress, save progression, remember state between sessions, and run an action only on the first use.

https://docs.pandasuite.com/essentials/gamification/unlock-content-progressively/

**Use local variables and conditions to restrict access to screens based on what the user has already done, or to run an action only the first time the application opens.**

## Unlock a screen or step

This technique is useful for **non-linear experiences** :games, interactive narratives, free-roaming tours :where the user can navigate between screens in any order and you want to restrict access to certain content until they have completed something elsewhere.

In a strictly linear path, you do not need this: sequential navigation already prevents the user from skipping ahead.

**Step 1: Create a variable**

Add a [Datastore](https://docs.pandasuite.com/essentials/data/datastore/) and create a Boolean property (e.g., `step_1_done`). Leave the default value empty.

**Step 2: Set it to true on completion**

On the trigger that marks the step as done (button tap, end of video, etc.), add the action **Interact with a data source > Datastore > Create/Update Data (Local)**. Choose `step_1_done`, function **Set**, value `true`.

**Step 3: Create a condition**

Add a [Condition](https://docs.pandasuite.com/essentials/components/condition/) component. Create a condition: `step_1_done` **Equal to** `true`, with **Automatic evaluation** enabled.

**Step 4: Bind visibility**

Select the button or element that leads to the locked screen. Bind its **Visibility** property to the condition result. The element stays hidden until the condition is met.

## Run an action only on the first use

Use this to show a one-time welcome screen or onboarding overlay that should never repeat.

**Step 1: Create a variable**

Add a [Datastore](https://docs.pandasuite.com/essentials/data/datastore/) and create a Boolean property (e.g., `welcome_shown`). **Do not set a default value** :this is what distinguishes "never opened" from "already seen".

**Step 2: Create a condition**

Add a [Condition](https://docs.pandasuite.com/essentials/components/condition/) component. Create a condition: `welcome_shown` **Unknown or empty**.

**Step 3: Evaluate on screen display**

Select the screen (no object selected). In the **Actions** panel, add a **Current Screen Display** trigger. Action: **Interact with a component > Conditions > Evaluate condition: welcome shown**.

**Step 4: React and mark as seen**

On the Condition component, for the **Evaluation: welcome shown** trigger, add two actions:

1. Show your overlay (open a pop-up, change a state, etc.)
2. Set `welcome_shown` to `true`

From the second visit onwards, the condition is false and the overlay is skipped.

> **Info**
>
> The variable is stored locally on the device. For cross-device persistence,
> use a [Firebase Session](https://docs.pandasuite.com/essentials/components/firebase-session/) variable
> instead.

## Related articles

- [Variables](https://docs.pandasuite.com/essentials/data/variables/)
- [Condition](https://docs.pandasuite.com/essentials/components/condition/)
- [Automatically trigger actions](https://docs.pandasuite.com/essentials/interactions/automatically-trigger-actions/)
- [Object visibility](https://docs.pandasuite.com/essentials/layout/object-visibility/)
