Set the default value of a variable based on what the user enters in another component.
This design pattern is not recommended for offline interfaces because reflecting immediate changes in an interface based on user interaction requires a connection to the server.
This example only applies when the default value is based on the user's input in another component. See Set the Default Value of an Input on a Task Form recipe when the default value must be set as soon as the form is displayed and without requiring the user to interact with the form.
Test it out
Type into the Username field and notice that the Email field is pre-populated.
Type into the Username field, then modify the Email value, and type into the Username field again. The Email field is no longer pre-populated.
Notice that the value of username as well as the email address field are updated as you type. That's because the username input is configured with refreshAfter: "KEYPRESS"