How to clear text from an Input Field
When automating form filling, you may encounter input fields that are already populated with default values. The "Enter text" step should clear those values automatically. However, if it does not, it can lead to messy results when the bot runs, especially if the existing value isn't cleared using the "Enter text" step.
But don't worry—this guide will show you a simple and effective way to clear those default values. All you need to do is use a combination of the "Click element" and "Press key(s)" steps.
Design pattern: Clear input field
- 1 Click element
- 2 Press Key(s)
# Insert the following steps into your automation
Assuming you have a bot set up in Axiom.ai. insert the following steps before the "Enter text" step you wish to enter a value with. Using the step finder add the following steps.
# Add a "Click element" step to position the cursor
First we use a "Click element" step to insert the cursor into the input we wish to remove the value from. With the step added:
- Select - Click "Select" highlight the input with the value use wish to delete and press "Complete".
# Add a ‘Press key(s)’ to delete the value
Finally we use a ‘Press key(s)’ step to delete the value inside the input with a combination of keys. We use the right arrow to go past the value with the cursor and then delete to remove the values characters.
- Key - Press ‘Record’ then ‘→→→→→→→→→→’ and ‘⌦ ⌦ ⌦ ⌦ ⌦ ⌦ ⌦ ⌦ ⌦ ’ finally click ‘Stop recording.
TIP
💡 When you run the bot, you will see the cursor move to the right past the value and then back, deleting it. There are other useful shortcuts to discover.
That's it! Assuming your "nter Text" step is next, the input field will now be cleared, and the new data will be entered without any issues.
# Wrapping up
This is a simple way to clear prepopulated text in form automation. You can empty an input field by employing the "Click element" and "Press keys(s)" steps. This method enhances the reliability of your form automation tasks, helping you achieve accurate results with minimal effort.