fillForms()
function.
This function lets AI agents:
- Find and fill multiple web forms automatically.
- Add user-provided data efficiently and accurately.
- Track the status of each submission in real time.
- Complete all tasks without manual intervention.
Example
The sample below shows you how to fill and automate forms:Fill and automate forms
The steps below show you how to fill and automate forms using the Agent Platform JavaScript SDK:Step 1: Define the forms
Create an array of forms with the URL and data you want to submit.Step 2: Start a form-filling task
For each form, callagent.fillForm(url, data)
to let the agent fill the form automatically.
Step 3: Track task status
Usetask.onStatusChange
to monitor updates and see progress in real time.
Step 4: Wait for completion
Callawait task.waitForCompletion()
to ensure the agent finishes before moving on to the next form.