# Score

> Learn how to manage scores in your PandaSuite applications, including creating and using score variables to trigger actions and reset scores effectively.

https://docs.pandasuite.com/essentials/gamification/score/

**The score allows you to count points based on the user's actions and set up a scenario based on that number. You can display the score in the application and use it to trigger actions.**

In concrete terms, the score is a variable whose value is incremented or decremented according to the user's actions.

[Image: Quiz results screen on a phone, showing FINAL SCORE 3/5 above a TRY AGAIN button]

#### In this article

- [Create a score variable](https://docs.pandasuite.com/essentials/gamification/score/#create-a-score-variable)
- [Increment / Decrement score](https://docs.pandasuite.com/essentials/gamification/score/#incrementdecrement-score)
- [Display score](https://docs.pandasuite.com/essentials/gamification/score/#display-score)
- [Reset score](https://docs.pandasuite.com/essentials/gamification/score/#reset-score)
- [Trigger an action based on score](https://docs.pandasuite.com/essentials/gamification/score/#trigger-an-action-based-on-score)

## Create a score variable

Create the variable *score* in the right place according to your usage:

- If your score has only local usage, meaning it is only stored and displayed on the user's device, create your [variable](https://docs.pandasuite.com/essentials/data/variables/) *score* in the [Datastore](https://docs.pandasuite.com/essentials/data/datastore/).
- If your score is associated with a user and you want to reuse that data in Cloud Firestore, create a *score* data associated with your user (requires Firebase authentication).

[Image: Datastore with the score variable, of type Number and value 0]

## Increment/Decrement Score

To increment or decrement the score, select the trigger and click the button **+** button in Actions.

Select the action **Interact with a data source** > **Datastore** or **Firebase Session** > **Create/Update Data (Local)**. Choose `score` as the **Target**, select the **Function** **Increment** or **Decrement**, and define the **Value**.

[Image: When the plant quiz answer is tulip: Create/Update Data (Local) on Datastore 1, Target /score, Function Increment, Value 1, framed]

## Display score

Thanks to [data binding](https://docs.pandasuite.com/essentials/data/data-binding/), you can display your score.

Select a text block

In the properties, create a data binding on the value of your score variable.

[Image: Data window of the “Score: … /5” text on the plant quiz: the path Datastore 1 > score and the text are framed]

## Reset score

To ensure that your score does not increment with each use, it is necessary to reset it at the beginning of your activity.

To reset the score, simply reset the variable *score* to zero.

Choose the action **Interact with a data source** > **Datastore** or **Firebase Session** > **Create/Update Data (Local)**. Use `score` as the **Target**, the **Function** **Set**, and `0` as the **Value**:

[Image: When the plant quiz screen is displayed: Create/Update Data (Local), Target /score, Function Set, Value 0, framed]

## Trigger an action based on score

If you want to trigger an action based on the score, you need [create a condition](https://docs.pandasuite.com/essentials/components/condition/).

## See also

- [Build a leaderboard](https://docs.pandasuite.com/essentials/gamification/leaderboard/)
