Ask AI
Skip to main content

Get value of number field

Function: Get value of number field

This action helps you retrieve the number that a user has entered into a specific "Number Input Field" on your application's screen. Once retrieved, this number can be saved into a variable, allowing you to use it in other parts of your application's logic, such as calculations, comparisons, or displaying it elsewhere.

Input

  • UI element: This is the specific "Number Input Field" on your application's screen from which you want to get the value. You need to select the exact field you've placed on your page. It must be a field designed to accept only numerical input.

Output

  • Answer: This is the number retrieved from the selected "UI element". This number will be stored in a variable. By default, this variable will be named NUMBER_FIELD_ANSWER, but you can choose a different name if you prefer. This variable will always hold a numerical value.

Execution Flow

Real-Life Examples

Here are some practical ways you can use the "Get value of number field" action:

Example 1: Calculating a Total Price

Imagine you have an online order form where users can specify the quantity of an item.

  • Inputs:
    • UI element: Select the "Quantity" number input field on your order form.
  • Result: If the user enters 5 into the "Quantity" field, the number 5 is stored in the NUMBER_FIELD_ANSWER variable. You can then use this variable in a subsequent action to multiply it by the item's unit price to calculate the total cost.

Example 2: Validating User Age

You might have a registration form where you need to check if a user meets a minimum age requirement.

  • Inputs:
    • UI element: Select the "Age" number input field on your registration form.
    • Answer (variable name): UserAge (You choose a custom name for clarity).
  • Result: If the user enters 25 into the "Age" field, the number 25 is stored in the UserAge variable. You can then use this UserAge variable in a condition to determine if the user is old enough to proceed.

Example 3: Updating Inventory Stock

In an inventory management application, you might allow users to add a certain number of items to stock.

  • Inputs:
    • UI element: Select the "Items Added" number input field on your inventory screen.
    • Answer (variable name): ItemsToAddToStock
  • Result: If the user enters 100 into the "Items Added" field, the number 100 is stored in the ItemsToAddToStock variable. This variable can then be used to update the total stock count for a product in your database.