> ## Documentation Index
> Fetch the complete documentation index at: https://botpress-charmenta-pr-583.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Scoping variables

export const GoodToKnow = ({children}) => {
  return <Callout icon="notebook-pen" color="#65d15a" iconType="regular">
      {children}
    </Callout>;
};

Every variable has a *scope* that determines where and when your bot can access it.

Try restarting the conversation. Select **<Icon icon="rotate-ccw" />** in the Emulator, then send a message:

<Frame>
  <img alt="New conversation" className="block dark:hidden" src="https://mintcdn.com/botpress-charmenta-pr-583/nqaL_ELiyzNh3Tk1/tutorial/basics/storing-information/assets/new-conversation.png?fit=max&auto=format&n=nqaL_ELiyzNh3Tk1&q=85&s=54e14373681bfc7d66f8950fc65a7fa4" width="1260" height="490" data-path="tutorial/basics/storing-information/assets/new-conversation.png" />

  <img alt="New conversation" className="hidden dark:block" src="https://mintcdn.com/botpress-charmenta-pr-583/nqaL_ELiyzNh3Tk1/tutorial/basics/storing-information/assets/new-conversation-dark.png?fit=max&auto=format&n=nqaL_ELiyzNh3Tk1&q=85&s=d3475122945ac6f8ea5381ef53a7eca0" width="1260" height="490" data-path="tutorial/basics/storing-information/assets/new-conversation-dark.png" />
</Frame>

That's not ideal—the bot asked for our name again, even though we already told it in a previous conversation.

This is because `firstName` is a *Workflow* variable—it keeps the same value for the current Workflow, then resets when the Workflow is done its execution. Since each new conversation re-executes the Main Workflow, the value resets every time.

<GoodToKnow>
  Newly-created variables have the Workflow scope by default.
</GoodToKnow>

## Changing a variable's scope

Let's change `firstName` to a *User* variable:

1. In the Variables section, hover over `firstName` and select **<Icon icon="pen" />** to edit it.
2. In the **Scope** drop-down, switch from **Workflow** to **User**.
3. Select **Save**.

Now, go back to the Emulator and repeat the process. Start one conversation and tell it your name:

<Frame>
  <img alt="Variable test" className="block dark:hidden" src="https://mintcdn.com/botpress-charmenta-pr-583/nqaL_ELiyzNh3Tk1/tutorial/basics/storing-information/assets/variable-test.png?fit=max&auto=format&n=nqaL_ELiyzNh3Tk1&q=85&s=0194913e10719408252bdfcde532fa90" width="1264" height="804" data-path="tutorial/basics/storing-information/assets/variable-test.png" />

  <img alt="Variable test" className="hidden dark:block" src="https://mintcdn.com/botpress-charmenta-pr-583/nqaL_ELiyzNh3Tk1/tutorial/basics/storing-information/assets/variable-test-dark.png?fit=max&auto=format&n=nqaL_ELiyzNh3Tk1&q=85&s=f16e01e01c8fa093061b31cd6b66f0e2" width="1264" height="804" data-path="tutorial/basics/storing-information/assets/variable-test-dark.png" />
</Frame>

Then, select **<Icon icon="rotate-ccw" />** to restart the conversation and send a message:

<Frame>
  <img alt="User variable test" className="block dark:hidden" src="https://mintcdn.com/botpress-charmenta-pr-583/nqaL_ELiyzNh3Tk1/tutorial/basics/storing-information/assets/user-variable-test.png?fit=max&auto=format&n=nqaL_ELiyzNh3Tk1&q=85&s=120a488a85e223c95e6c8a1f9a2af92d" width="1260" height="492" data-path="tutorial/basics/storing-information/assets/user-variable-test.png" />

  <img alt="User variable test" className="hidden dark:block" src="https://mintcdn.com/botpress-charmenta-pr-583/nqaL_ELiyzNh3Tk1/tutorial/basics/storing-information/assets/user-variable-test-dark.png?fit=max&auto=format&n=nqaL_ELiyzNh3Tk1&q=85&s=326e3e12e3ba66911354fc9d59bc3048" width="1260" height="492" data-path="tutorial/basics/storing-information/assets/user-variable-test-dark.png" />
</Frame>

Much better! The bot remembered the name from our previous conversation. Notice that in the Variables section, the value stayed the same:

<Frame>
  <img alt="User variable" className="block dark:hidden" src="https://mintcdn.com/botpress-charmenta-pr-583/nqaL_ELiyzNh3Tk1/tutorial/basics/storing-information/assets/user-variable.png?fit=max&auto=format&n=nqaL_ELiyzNh3Tk1&q=85&s=a47fd85f2ffa0b535cddeb5d7ae9bf75" width="1198" height="280" data-path="tutorial/basics/storing-information/assets/user-variable.png" />

  <img alt="User variable" className="hidden dark:block" src="https://mintcdn.com/botpress-charmenta-pr-583/nqaL_ELiyzNh3Tk1/tutorial/basics/storing-information/assets/user-variable-dark.png?fit=max&auto=format&n=nqaL_ELiyzNh3Tk1&q=85&s=b77fd16bd931f5ec73ac6797bac295b7" width="1198" height="280" data-path="tutorial/basics/storing-information/assets/user-variable-dark.png" />
</Frame>
