Ask AI
Skip to main content

Create a number

Function: Create a number

This action allows you to create a new variable in your application's memory that stores a whole number. You can then use this variable in other actions, calculations, or to display information to your users. It's perfect for keeping track of quantities, scores, counts, or any other numerical data within your application's logic.

Input

  • Value (Type: NUMBER) The specific whole number you want to store in your new variable. This is the actual numerical data that the variable will hold.
  • Variable name (Type: STRING) The unique name you want to give to this new number variable. This name acts as an identifier, allowing you to easily reference and use the variable in other parts of your application. For example, you might name it totalItems, userScore, or productQuantity.

Output

  • New Number Variable A new variable is created in your application's memory. It will hold the NUMBER value you provided and can be referenced by the Variable name you specified. This variable is now available for use in subsequent actions within your application flow.

Execution Flow

Real-Life Examples

Here are some practical ways you can use the "Create a number" action in your no-code application:

Example 1: Tracking a Shopping Cart Total

Imagine you're building an e-commerce application and want to keep a running total of items in a user's cart.

  • Inputs:
    • Value: 0
    • Variable name: cartItemCount
  • Result: A new variable named cartItemCount is created, holding the number 0. You can then increment this variable each time a user adds an item to their cart.

Example 2: Setting a Default Discount Percentage

For a promotional campaign, you might want to define a standard discount that can be applied to products.

  • Inputs:
    • Value: 15
    • Variable name: defaultDiscount
  • Result: A new variable named defaultDiscount is created, holding the number 15. This variable can then be used in calculations to apply a 15% discount.

Example 3: Initializing a Game Score

In a simple game application, you need to start a player's score at zero.

  • Inputs:
    • Value: 0
    • Variable name: playerScore
  • Result: A new variable named playerScore is created, holding the number 0. As the player earns points, you can update this variable using other actions.