Skip to content

Input value

The input value configuration allows you to dynamically pre-fill a specific input field within your form. Unlike form values, which enables setting multiple inputs at once, input value focuses on a single field, providing more granular control.

How does It work?

  1. Select the input field: Ensure the input field you want to populate has the wized attribute so that Wized can recognize and manipulate it.

  2. Apply the input value: In Wized, Navigate to the settings tab in the right panel and select the input value configuration.

  3. Define the value in the function editor: Use the Function Editor to return the specific value that should populate the input. The value can come from various sources such as variables, cookies, URL parameters, API responses, or other dynamic data.

    javascript
    return r.get_user.data.name || '';
  4. Real time updates: If the user manually changes the value of the input, the new value will be reflected in the Data Store in real-time, allowing you to track changes dynamically.

Considerations

  • Wized attribute required The input field must have the wized attribute to be recognized and updated by Wized.

  • Data type compatibility The assigned value must match the expected data type of the input field (e.g., a number input must receive a numerical value).

  • User modified values: Unlike Form Values, user-modified input values are accessible in real-time. If a user manually updates the field, the new value will be reflected in the Data Store and can be used dynamically within Wized.

  • Reactive behavior If the assigned value is not available at the time of execution, the input will remain empty. However, once the data source becomes available, Wized will automatically update the input field.

Use cases

  • Pre-filling forms: If you have user information stored in cookies or variables, or your DB, you can use "Input Value" to pre-fill form fields.
  • Displaying search results: When performing a search, this function can be used to show the search terms within an input field. This allows you to edit or refine your queries.
  • Updating input fields based on other values: You can use conditional logic in the Function Editor to update the value of an input based on other data from your application.