> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://documentation.celestory.io/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# 🟦 Assign

# 🟦 Assign

${frame}[Video: anatomy of the Assign block](https://celestory-docs-videos.netlify.app/en/anatomie-bloc/assign.html)

![Assign](https://celestory-docs-illustrations.netlify.app/en/Assign_EN.svg)

The Assignment block allows you to modify the value of a variable during an experiment. It is essential for dynamically updating data like a score, counter or any other information stored in a variable.

This block completely replaces the previous value of the variable with the new value provided, which distinguishes it from other blocks like Increment which modify an existing value without overwriting it.

## 📥 Entries

- in (Flux): Block trigger. When the flow reaches this point, the target variable is updated.
- variable (Variable): Variable to modify (can be of type Text, Number, Boolean, Image, List, File, Object, etc.). When the variable is chosen in the editing window and nothing is wired to `variable` or `value`, the block is drawn compact as « variable = value » with only `in` and `out`: the variable and the value are then set in the editing window.
- value (Dynamic type): New value which will replace the old one. The type automatically adapts to that of the selected variable. This point only appears once the variable is chosen.

## 📤 Outings

- out (Flow): Activates immediately after modifying the variable, allowing the flow to continue.

## 💡 Example of use

${frame}[Video: the Variable block, with Assign and Increment](https://celestory-docs-videos.netlify.app/en/graphe-blocs/variable.html)

Scenario: Updating a player's score after a success

1. A player completes a challenge in an interactive game.
1. The flow arrives at a Condition block checking if the challenge is successful.
1. If the condition is true, the flow is redirected to an Assignment block.
1. The Assignment block modifies the Score variable by assigning it the value 100.
1. The flow continues to a Display block to inform the player of their new score.

## ⚙️ Technical Details

- Behavior of variables: The previous value of the variable is completely overwritten by the new value provided. For operations like increment, use the Increment block instead.
- Dynamic adaptation: The value field automatically adapts to the type of the selected variable (number, text, etc.).

---

*Documented version: v1*