Fetch data from API and fill form
is there anyway to achieve this in filament? a form with a text input, and a fetch button. enter user's social security number, and fetch all other data and fill the form automatically.
Solution:Jump to solution
You can use a suffix action on the text input. Here, you can inject the $state and the $set variables. The latter allows you to set the state values of other fields in your form. I hope this helps
```php
return $form
->schema([
Forms\Components\TextInput::make('social_security_number')...
5 Replies
I'm sure there's a way. I'll do some research and will let you know.
Solution
You can use a suffix action on the text input. Here, you can inject the $state and the $set variables. The latter allows you to set the state values of other fields in your form. I hope this helps
@shaan It's been a few days. Is it OK if I mark this as solved?
yes. Thank you so much for the help 🙂