Ask AI
Skip to main content

Set value of input field

Function: Set value of input field

This action allows you to programmatically set the value of a specific input field on your application's form. This is useful for pre-filling forms, updating fields based on other actions, or automating data entry. Once set, the new value is stored within the input field and can be used by other parts of your application.

Input

  • UI element (PART): This is the specific input field on your form that you want to update. You'll select it directly from your application's design interface. This input is required.
  • Answer (STRING): This is the value you want to place into the selected input field. You can provide a direct text, number, or date, or you can use a variable from your application (e.g., \{\{CustomerName\}\}) to dynamically set the field's content.

Output

This action does not produce a direct output variable. Instead, it updates the selected 'UI element' (input field) with the provided 'Answer'. The updated value is then available within that input field for any subsequent actions or display on your form.

Execution Flow

Real-Life Examples

Here are some practical examples of how you can use the "Set value of input field" action:

Example 1: Pre-filling a User's Name

  • Scenario: After a user logs into your application, you want to automatically populate their full name into a "Customer Name" input field on an order form.
  • Inputs:
    • UI element: Select the Customer Name Input Field from your form.
    • Answer: \{\{CurrentUser.FullName\}\} (assuming CurrentUser.FullName is a variable holding the logged-in user's full name).
  • Result: The "Customer Name Input Field" on the order form will automatically display the logged-in user's full name, saving them time.

Example 2: Updating a Quantity Field Based on a Button Click

  • Scenario: You have a product detail page with a "Quantity" input field and an "Add 1" button. When the button is clicked, you want to increase the quantity shown in the input field.
  • Inputs:
    • UI element: Select the Product Quantity Input Field.
    • Answer: \{\{ProductQuantity + 1\}\} (assuming ProductQuantity is a variable that holds the current value of the input field).
  • Result: Each time the "Add 1" button is clicked, the value in the "Product Quantity Input Field" will increase by one.

Example 3: Setting a Default Date for a New Record

  • Scenario: When a user opens a new "Task Creation" form, you want the "Due Date" input field to automatically default to tomorrow's date.
  • Inputs:
    • UI element: Select the Task Due Date Input Field.
    • Answer: \{\{Tomorrow\(\)\}\} (assuming Tomorrow\(\) is a function available in your platform that returns tomorrow's date).
  • Result: When the "Task Creation" form loads, the "Task Due Date Input Field" will automatically show tomorrow's date, which the user can then change if needed.