Fill form data from from Controller

I have this custom field that behaves just like a normal TextInput, but i've place a button near it that wen pressed send an event with the current value of the field to its controller. The controller then makes an API request to a server and gets some data back that must me inserted in the other field of the form.
The question I have is, is there any wayt to set this data without making another custom field?

This is how I send the event:

wire:click="dispatchFormEvent('Component::eventName', $state)"

And this is how I register that event in the controller:

protected function setUp(): void
    {
        $this->registerListeners([
            'Component::eventName' => [
                function ($component, $customValue) {
                   //Send API request with $customValue
                },
            ],
        ]);
    }
Solution
This should be possible with just plain Filament actions
Was this page helpful?