Ask AI
Skip to main content

Set value of number field

Function: Set value of number field

This action allows you to assign a specific numerical value to a Number Input Field on your form. It's useful for pre-filling fields, updating them based on calculations, or clearing their content. The updated value is then available for further processing within your application's logic.

Input

  • UI element: The specific Number Input Field on your form that you want to update. This is a required input.
  • Answer: The numerical value you want to assign to the selected Number Input Field. This can be a fixed number or a value from another part of your application (e.g., a variable or the output of a previous action). If left empty, the field will be cleared.

Output

This action does not produce a direct output that can be used in subsequent steps. It updates the specified Number Input Field on your form, and this change is reflected in the application's state.

Execution Flow

Real-Life Examples

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

Example 1: Pre-filling a quantity field in an order form

Imagine you have an order form where customers often order a default quantity of "1". You can use this action to automatically set the quantity.

  • Inputs:
    • UI element: Quantity Input Field (the number input field on your order form)
    • Answer: 1
  • Result: When the form loads or a specific event occurs, the "Quantity Input Field" on the order form will automatically display the value "1".

Example 2: Clearing a discount percentage after a promotion ends

If a promotional discount has expired, you might want to clear the discount percentage field on a product editing page.

  • Inputs:
    • UI element: Discount Percentage Field (the number input field for discounts)
    • Answer: (leave this field empty)
  • Result: The "Discount Percentage Field" on the product editing page will be cleared, effectively removing any applied discount.

Example 3: Updating a calculated total score in a quiz application

After a user completes a quiz, you might calculate their total score using other actions. You can then display this score in a dedicated "Total Score" field.

  • Inputs:
    • UI element: Total Score Display Field (the number input field where the final score is shown)
    • Answer: \{\{ quiz_score_variable \}\} (assuming quiz_score_variable holds the calculated score from a previous step)
  • Result: The "Total Score Display Field" on the quiz results page will show the numerical value stored in the quiz_score_variable.