© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
5 replies
urbycoz

How can I dynamically update my Select options based on an API

I've got a textInput where a user can enter their zipcode/postcode and a button that does a lookup via an API.

I'd like to find a way to make the options in the Select update. Is it possible?

private $addresses;
...

TextInput::make('addressLookupText')
                ->label('Address Lookup'),
            Actions::make([
                Action::make('Address Lookup Button')
                    ->label('Find Address')
                    ->action(function (Get $get) {
                        $this->addresses = $this->findAddresses($get('addressLookupText'));
                    }),
            ]),
            Select::make('addresses')
                ->options($this->addresses)
                ->label('Select an address'),
private $addresses;
...

TextInput::make('addressLookupText')
                ->label('Address Lookup'),
            Actions::make([
                Action::make('Address Lookup Button')
                    ->label('Find Address')
                    ->action(function (Get $get) {
                        $this->addresses = $this->findAddresses($get('addressLookupText'));
                    }),
            ]),
            Select::make('addresses')
                ->options($this->addresses)
                ->label('Select an address'),
Solution
Why two separate fields? I’m doing something similar but with just one select (using the getSearchResultsUsing method on the select). Works great. When a result is selected I also set some other fields.
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Dynamically update rules based on Select option
FilamentFFilament / ❓┊help
2y ago
How to dynamically update Province select based on Region select in Filament Tables filter?
FilamentFFilament / ❓┊help
15mo ago
Update TextInput based on Select value
FilamentFFilament / ❓┊help
3y ago
dynamically add fields based on an array
FilamentFFilament / ❓┊help
3y ago